[patch] don't compile unused code in gmessages.c



Hi,

here's a small patch that puts printf_string_upper_bound()
into #if !HAVE_C99_VSNPRINTF  ...  #endif. The patch 
assumes that HAVE_C99_VSNPRINTF implies HAVE_VSNPRINTF
but I think this is a valid assumption. OK to commit ?


Salut, Sven

Index: glib/gmessages.c
===================================================================
RCS file: /cvs/gnome/glib/glib/gmessages.c,v
retrieving revision 1.39
diff -u -p -r1.39 gmessages.c
--- glib/gmessages.c	2001/12/06 22:37:05	1.39
+++ glib/gmessages.c	2001/12/28 14:16:03
@@ -71,10 +71,11 @@ struct _GLogHandler
 
 
 /* --- prototypes --- */
+#if !HAVE_C99_VSNPRINTF
 static gsize printf_string_upper_bound (const gchar *format,
 					gboolean     may_warn,
 					va_list      args);
-
+#endif
 
 /* --- variables --- */
 
@@ -860,6 +861,8 @@ g_printerr (const gchar *format,
 #  define MB_LEN_MAX 8
 #endif
 
+#if !HAVE_C99_VSNPRINTF
+
 typedef struct
 {
   guint min_width;
@@ -1167,6 +1170,9 @@ printf_string_upper_bound (const gchar *
 
   return len;
 }
+
+#endif /* !HAVE_C99_VSNPRINTF */
+
 
 gsize
 g_printf_string_upper_bound (const gchar *format,



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