Glib logging disable patch



This patch is critical in compiling a slimmed down glib.
Is this ok to check in?

/ Alex

Index: gmessages.h
===================================================================
RCS file: /cvs/gnome/glib/gmessages.h,v
retrieving revision 1.1
diff -u -p -r1.1 gmessages.h
--- gmessages.h	2000/10/12 11:52:07	1.1
+++ gmessages.h	2000/12/22 14:44:31
@@ -97,7 +97,39 @@ GLogLevelFlags  g_log_set_always_fatal
 #ifndef G_LOG_DOMAIN
 #define G_LOG_DOMAIN    ((gchar*) 0)
 #endif  /* G_LOG_DOMAIN */
+
+#if defined(G_DISABLE_LOGGING)
+
 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+#define g_error(...)    (void)0
+#define g_message(...)  (void)0
+#define g_critical(...) (void)0
+#define g_warning(...)  (void)0
+#elif __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 4)
+#define g_error(format...) (void)0
+#define g_message(format...) (void)0
+#define g_critical(format...) (void)0
+#define g_warning(format...) (void)0
+#else   /* !__GNUC__ */
+static void
+g_error (const gchar *format, ...)
+{
+}
+static void
+g_message (const gchar *format, ...)
+{
+}
+static void
+g_critical (const gchar *format, ...)
+{
+}
+static void
+g_warning (const gchar *format, ...)
+{
+}
+#endif
+
+#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
 #define g_error(...)    g_log (G_LOG_DOMAIN,         \
                                G_LOG_LEVEL_ERROR,    \
                                __VA_ARGS__)





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]