[PATCH 1/4] widl: Introduce format_namespace_buffer helper.

Alexandre Julliard julliard at winehq.org
Tue Dec 1 06:38:09 CST 2020


Rémi Bernon <rbernon at codeweavers.com> writes:

> @@ -89,41 +89,41 @@ const char *type_get_name(const type_t *type, enum name_type name_type)
>      return NULL;
>  }
>  
> -static char *append_namespace(char *ptr, struct namespace *namespace, const char *separator)
> +#define append_buf(f, ...)                                          \
> +    do {                                                            \
> +        int r = f(buf + ret, max(ret, len) - ret, ## __VA_ARGS__);  \
> +        assert(r >= 0);                                             \
> +        ret += r;                                                   \
> +    } while(0)
> +

That sort of macro hiding a function call is not very nice. Please use
strmake() or similar helpers instead.

-- 
Alexandre Julliard
julliard at winehq.org



More information about the wine-devel mailing list