X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=blobdiff_plain;f=include%2Fbabeltrace2%2Fbabeltrace.h;h=c94576a7810f825a2cfec808eba94a4f5dc1b191;hp=3f919cf30a6ea65f29caf4b5de8fa6ac30d485e1;hb=8b305066676fc7aa433e8eb668f9de8802008025;hpb=28ba44ad9ca14153e96c94a9100423ea224c1af3 diff --git a/include/babeltrace2/babeltrace.h b/include/babeltrace2/babeltrace.h index 3f919cf3..c94576a7 100644 --- a/include/babeltrace2/babeltrace.h +++ b/include/babeltrace2/babeltrace.h @@ -44,6 +44,23 @@ # define __BT_UPCAST_CONST(_type, _p) ((const _type *) (_p)) #endif +/* + * Internal: attribute suitable to tag functions as having printf()-like + * arguments. + * + * We always define `__USE_MINGW_ANSI_STDIO` when building with MinGW, so use + * `gnu_printf` directly rather than `__MINGW_PRINTF_FORMAT` (which would require + * including `stdio.h`). + */ +#ifdef __MINGW32__ +# define __BT_PRINTF_FORMAT gnu_printf +#else +# define __BT_PRINTF_FORMAT printf +#endif + +#define __BT_ATTR_FORMAT_PRINTF(_string_index, _first_to_check) \ + __attribute__((format(__BT_PRINTF_FORMAT, _string_index, _first_to_check))) + #include #include #include