diff options
author | Chun-wei Fan <fanchunwei@src.gnome.org> | 2017-01-16 15:43:32 +0800 |
---|---|---|
committer | Philip Chimento <philip.chimento@gmail.com> | 2017-01-19 19:32:45 -0800 |
commit | 366aa43fda5d1ea69c687b6ead706618022b47af (patch) | |
tree | 4b293f085367aeacd06240cb64a8165909bf8eca | |
parent | fadddccb7bae1ee9b67ec3229e73995527845cff (diff) | |
download | gjs-wip/ptomato/windows.tar.gz |
Header: Avoid GCCismswip/ptomato/windows
Use ISO-style vararg syntax for the logging items so that things will
work on non-GCC, and use G_GNUC_UNUSED in place of __attribute__((unused)),
which achives the same purpose when GCC is used, and expands to
nothing otherwise.
https://bugzilla.gnome.org/show_bug.cgi?id=775868
-rw-r--r-- | gjs/jsapi-util.h | 4 | ||||
-rw-r--r-- | util/log.h | 36 |
2 files changed, 20 insertions, 20 deletions
diff --git a/gjs/jsapi-util.h b/gjs/jsapi-util.h index 78cc4a9f..c26e40f8 100644 --- a/gjs/jsapi-util.h +++ b/gjs/jsapi-util.h @@ -76,7 +76,7 @@ typedef struct GjsRootedArray GjsRootedArray; * do_base_typecheck and priv_from_js */ #define GJS_DEFINE_PRIV_FROM_JS(type, klass) \ - __attribute__((unused)) static inline bool \ + G_GNUC_UNUSED static inline bool \ do_base_typecheck(JSContext *context, \ JS::HandleObject object, \ bool throw_error) \ @@ -93,7 +93,7 @@ typedef struct GjsRootedArray GjsRootedArray; JS_EndRequest(context); \ return priv; \ } \ - __attribute__((unused)) static bool \ + G_GNUC_UNUSED static bool \ priv_from_js_with_typecheck(JSContext *context, \ JS::HandleObject object, \ type **out) \ @@ -112,45 +112,45 @@ typedef enum { #endif #if GJS_VERBOSE_ENABLE_PROPS -#define gjs_debug_jsprop(topic, format...) \ - do { gjs_debug(topic, format); } while(0) +#define gjs_debug_jsprop(topic, ...) \ + do { gjs_debug(topic, __VA_ARGS__); } while(0) #else -#define gjs_debug_jsprop(topic, format...) ((void)0) +#define gjs_debug_jsprop(topic, ...) ((void)0) #endif #if GJS_VERBOSE_ENABLE_MARSHAL -#define gjs_debug_marshal(topic, format...) \ - do { gjs_debug(topic, format); } while(0) +#define gjs_debug_marshal(topic, ...) \ + do { gjs_debug(topic, __VA_ARGS__); } while(0) #else -#define gjs_debug_marshal(topic, format...) ((void)0) +#define gjs_debug_marshal(topic, ...) ((void)0) #endif #if GJS_VERBOSE_ENABLE_LIFECYCLE -#define gjs_debug_lifecycle(topic, format...) \ - do { gjs_debug(topic, format); } while(0) +#define gjs_debug_lifecycle(topic, ...) \ + do { gjs_debug(topic, __VA_ARGS__); } while(0) #else -#define gjs_debug_lifecycle(topic, format...) ((void)0) +#define gjs_debug_lifecycle(topic, ...) ((void)0) #endif #if GJS_VERBOSE_ENABLE_GI_USAGE -#define gjs_debug_gi_usage(format...) \ - do { gjs_debug(GJS_DEBUG_GI_USAGE, format); } while(0) +#define gjs_debug_gi_usage(...) \ + do { gjs_debug(GJS_DEBUG_GI_USAGE, __VA_ARGS__); } while(0) #else -#define gjs_debug_gi_usage(format...) ((void)0) +#define gjs_debug_gi_usage(...) ((void)0) #endif #if GJS_VERBOSE_ENABLE_GCLOSURE -#define gjs_debug_closure(format...) \ - do { gjs_debug(GJS_DEBUG_GCLOSURE, format); } while(0) +#define gjs_debug_closure(...) \ + do { gjs_debug(GJS_DEBUG_GCLOSURE, __VA_ARGS__); } while(0) #else -#define gjs_debug_closure(format, ...) ((void)0) +#define gjs_debug_closure(...) ((void)0) #endif #if GJS_VERBOSE_ENABLE_GSIGNAL -#define gjs_debug_gsignal(format...) \ - do { gjs_debug(GJS_DEBUG_GOBJECT, format); } while(0) +#define gjs_debug_gsignal(...) \ + do { gjs_debug(GJS_DEBUG_GOBJECT, __VA_ARGS__); } while(0) #else -#define gjs_debug_gsignal(format...) ((void)0) +#define gjs_debug_gsignal(...) ((void)0) #endif void gjs_debug(GjsDebugTopic topic, |