Generate $module-public-headers.txt file, feed it to gtk-doc
[platform/upstream/glib.git] / glib / gmessages.h
index 5535833..9acaec6 100644 (file)
  * Modified by the GLib Team and others 1997-2000.  See the AUTHORS
  * file for a list of people on the GLib Team.  See the ChangeLog
  * files for a list of changes.  These files are distributed with
- * GLib at ftp://ftp.gtk.org/pub/gtk/. 
+ * GLib at ftp://ftp.gtk.org/pub/gtk/.
  */
 
+#if defined(G_DISABLE_SINGLE_INCLUDES) && !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
+#error "Only <glib.h> can be included directly."
+#endif
+
 #ifndef __G_MESSAGES_H__
 #define __G_MESSAGES_H__
 
@@ -130,9 +134,16 @@ void g_assert_warning         (const char *log_domain,
 #define G_LOG_DOMAIN    ((gchar*) 0)
 #endif  /* G_LOG_DOMAIN */
 #ifdef G_HAVE_ISO_VARARGS
-#define g_error(...)    g_log (G_LOG_DOMAIN,         \
+/* for(;;) ; so that GCC knows that control doesn't go past g_error().
+ * Put space before ending semicolon to avoid C++ build warnings.
+ */
+#define g_error(...)  G_STMT_START {                 \
+                        g_log (G_LOG_DOMAIN,         \
                                G_LOG_LEVEL_ERROR,    \
-                               __VA_ARGS__)
+                               __VA_ARGS__);         \
+                        for (;;) ;                   \
+                      } G_STMT_END
+                        
 #define g_message(...)  g_log (G_LOG_DOMAIN,         \
                                G_LOG_LEVEL_MESSAGE,  \
                                __VA_ARGS__)
@@ -146,9 +157,13 @@ void g_assert_warning         (const char *log_domain,
                                G_LOG_LEVEL_DEBUG,    \
                                __VA_ARGS__)
 #elif defined(G_HAVE_GNUC_VARARGS)
-#define g_error(format...)      g_log (G_LOG_DOMAIN,         \
+#define g_error(format...)    G_STMT_START {                 \
+                                g_log (G_LOG_DOMAIN,         \
                                        G_LOG_LEVEL_ERROR,    \
-                                       format)
+                                       format);              \
+                                for (;;) ;                   \
+                              } G_STMT_END
+                              
 #define g_message(format...)    g_log (G_LOG_DOMAIN,         \
                                        G_LOG_LEVEL_MESSAGE,  \
                                        format)
@@ -170,6 +185,8 @@ g_error (const gchar *format,
   va_start (args, format);
   g_logv (G_LOG_DOMAIN, G_LOG_LEVEL_ERROR, format, args);
   va_end (args);
+
+  for(;;) ;
 }
 static void
 g_message (const gchar *format,
@@ -324,4 +341,3 @@ GPrintFunc      g_set_printerr_handler  (GPrintFunc      func);
 G_END_DECLS
 
 #endif /* __G_MESSAGES_H__ */
-