diff options
author | Christian Persch <chpe@src.gnome.org> | 2018-10-31 11:50:07 +0100 |
---|---|---|
committer | Christian Persch <chpe@src.gnome.org> | 2018-10-31 11:50:07 +0100 |
commit | d62a07831c1fc047b3eebd508cfa47212e2cbe80 (patch) | |
tree | 243b62a39e83904b8a051ecde4817138d395782f /glib/gmacros.h | |
parent | 361fed5d75805b66726145c1a1e07f90563ab9c7 (diff) | |
download | glib-d62a07831c1fc047b3eebd508cfa47212e2cbe80.tar.gz |
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
Diffstat (limited to 'glib/gmacros.h')
-rw-r--r-- | glib/gmacros.h | 5 |
1 files changed, 5 insertions, 0 deletions
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 |