#include "ralloc.h"
-#ifdef __GNUC__
-#define likely(x) __builtin_expect(!!(x),1)
-#define unlikely(x) __builtin_expect(!!(x),0)
-#else
-#define likely(x) !!(x)
-#define unlikely(x) !!(x)
-#endif
-
#ifndef va_copy
#ifdef __va_copy
#define va_copy(dest, src) __va_copy((dest), (src))
#include <stddef.h>
#include <stdarg.h>
#include <stdbool.h>
+#include "main/compiler.h"
/**
* \def ralloc(ctx, type)
*
* \return The newly allocated string.
*/
-char *ralloc_asprintf (const void *ctx, const char *fmt, ...);
+char *ralloc_asprintf (const void *ctx, const char *fmt, ...) PRINTFLIKE(2, 3);
/**
* Print to a string, given a va_list.
* \return True unless allocation failed.
*/
bool ralloc_asprintf_rewrite_tail(char **str, size_t *start,
- const char *fmt, ...);
+ const char *fmt, ...)
+ PRINTFLIKE(3, 4);
/**
* Rewrite the tail of an existing string, starting at a given index.
*
* \return True unless allocation failed.
*/
-bool ralloc_asprintf_append (char **str, const char *fmt, ...);
+bool ralloc_asprintf_append (char **str, const char *fmt, ...)
+ PRINTFLIKE(2, 3);
/**
* Append formatted text to the supplied string, given a va_list.