reworked GCC-specific type-safe macro variant into something less verbose,
authorTim Janik <timj@gtk.org>
Fri, 2 Dec 2005 12:11:34 +0000 (12:11 +0000)
committerTim Janik <timj@src.gnome.org>
Fri, 2 Dec 2005 12:11:34 +0000 (12:11 +0000)
Fri Dec  2 13:08:58 2005  Tim Janik  <timj@gtk.org>

        * glib/gslice.h (g_slice_free): reworked GCC-specific type-safe macro
        variant into something less verbose, but digestible for gcc-3.4.

ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-12
glib/gslice.h

index e296ce7..0a92998 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Fri Dec  2 13:08:58 2005  Tim Janik  <timj@gtk.org>
+
+        * glib/gslice.h (g_slice_free): reworked GCC-specific type-safe macro
+        variant into something less verbose, but digestible for gcc-3.4.
+
 Fri Dec  2 10:55:07 2005  Tim Janik  <timj@imendio.com>
 
        * tests/slice-test.c: extended to perform the benchmarking on the old
index e296ce7..0a92998 100644 (file)
@@ -1,3 +1,8 @@
+Fri Dec  2 13:08:58 2005  Tim Janik  <timj@gtk.org>
+
+        * glib/gslice.h (g_slice_free): reworked GCC-specific type-safe macro
+        variant into something less verbose, but digestible for gcc-3.4.
+
 Fri Dec  2 10:55:07 2005  Tim Janik  <timj@imendio.com>
 
        * tests/slice-test.c: extended to perform the benchmarking on the old
index e296ce7..0a92998 100644 (file)
@@ -1,3 +1,8 @@
+Fri Dec  2 13:08:58 2005  Tim Janik  <timj@gtk.org>
+
+        * glib/gslice.h (g_slice_free): reworked GCC-specific type-safe macro
+        variant into something less verbose, but digestible for gcc-3.4.
+
 Fri Dec  2 10:55:07 2005  Tim Janik  <timj@imendio.com>
 
        * tests/slice-test.c: extended to perform the benchmarking on the old
index dc0cc2e..09c8a4e 100644 (file)
@@ -40,17 +40,17 @@ void     g_slice_free_chain     (gsize    block_size,
 #define  g_slice_new0(type)     ((type*) g_slice_alloc0 (sizeof (type)))
 /*       g_slice_free(type,mem) g_slice_free1 (sizeof (type), mem) */
 
-#if __GNUC__ >= 2
+#if    __GNUC__ >= 2
 /* for GCC, define a type-safe variant of g_slice_free() */
-#define  g_slice_free(type, mem)       ({                      \
-  static inline void g_slice_free (gsize, type*);              \
-  while (0) g_slice_free (sizeof (type), mem);                         \
-  g_slice_free1 (sizeof (type), mem);                          \
+#define g_slice_free(type, mem)        ({                       \
+  void (*g_slice_free) (gsize, type*);                          \
+  while (0) g_slice_free (sizeof (type), mem);                  \
+  g_slice_free1 (sizeof (type), mem);                           \
 })
-#else
+#else  /* !__GNUC__ */
 #define        g_slice_free(type, mem) g_slice_free1 (sizeof (type) + (gsize) (type*) 0, mem)
 /* we go through the extra (gsize)(type*)0 hoop to ensure a known type argument */
-#endif
+#endif /* !__GNUC__ */
 
 /* --- internal debugging API --- */
 typedef enum {