From d62a07831c1fc047b3eebd508cfa47212e2cbe80 Mon Sep 17 00:00:00 2001 From: Christian Persch Date: Wed, 31 Oct 2018 11:50:07 +0100 Subject: gmacros: Add G_GNUC_STRFTIME macro Analogous to G_GNUC_PRINTF and G_GNUC_SCANF, to annotate functions similar to strftime. https://gitlab.gnome.org/GNOME/glib/issues/1575 --- glib/gmacros.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'glib/gmacros.h') diff --git a/glib/gmacros.h b/glib/gmacros.h index 0432d9cad..5212d2fe8 100644 --- a/glib/gmacros.h +++ b/glib/gmacros.h @@ -165,11 +165,15 @@ __attribute__((__format__ (gnu_printf, format_idx, arg_idx))) #define G_GNUC_SCANF( format_idx, arg_idx ) \ __attribute__((__format__ (gnu_scanf, format_idx, arg_idx))) +#define G_GNUC_STRFTIME( format_idx ) \ + __attribute__((__format__ (gnu_strftime, format_idx, 0))) #else #define G_GNUC_PRINTF( format_idx, arg_idx ) \ __attribute__((__format__ (__printf__, format_idx, arg_idx))) #define G_GNUC_SCANF( format_idx, arg_idx ) \ __attribute__((__format__ (__scanf__, format_idx, arg_idx))) +#define G_GNUC_STRFTIME( format_idx ) \ + __attribute__((__format__ (__strftime__, format_idx, 0))) #endif #define G_GNUC_FORMAT( arg_idx ) \ __attribute__((__format_arg__ (arg_idx))) @@ -184,6 +188,7 @@ #else /* !__GNUC__ */ #define G_GNUC_PRINTF( format_idx, arg_idx ) #define G_GNUC_SCANF( format_idx, arg_idx ) +#define G_GNUC_STRFTIME( format_idx ) #define G_GNUC_FORMAT( arg_idx ) #define G_GNUC_NORETURN #define G_GNUC_CONST -- cgit v1.2.1