summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Lillqvist <tml@novell.com>2008-07-24 01:11:52 +0000
committerTor Lillqvist <tml@src.gnome.org>2008-07-24 01:11:52 +0000
commitb46641eab25d8f28794d27dcba04d51635c1a846 (patch)
tree11eb6c877edc15735b741353bcd61facae7e151c
parent440ebdec6ff0b6036349392b1a08cd0639d9d4d5 (diff)
downloadglib-b46641eab25d8f28794d27dcba04d51635c1a846.tar.gz
Define G_TYPE_FORMAT as the printf format for a GType value. Either
2008-07-24 Tor Lillqvist <tml@novell.com> * gtype.h: Define G_TYPE_FORMAT as the printf format for a GType value. Either G_GSIZE_FORMAT or "lu". * gtype.c: Use it instead of the C99 zu. svn path=/trunk/; revision=7250
-rw-r--r--gobject/ChangeLog7
-rw-r--r--gobject/gtype.c4
-rw-r--r--gobject/gtype.h2
3 files changed, 11 insertions, 2 deletions
diff --git a/gobject/ChangeLog b/gobject/ChangeLog
index 775464a1c..d582d27c4 100644
--- a/gobject/ChangeLog
+++ b/gobject/ChangeLog
@@ -1,3 +1,10 @@
+2008-07-24 Tor Lillqvist <tml@novell.com>
+
+ * gtype.h: Define G_TYPE_FORMAT as the printf format for a GType
+ value. Either G_GSIZE_FORMAT or "lu".
+
+ * gtype.c: Use it instead of the C99 zu.
+
2008-07-23 Matthias Clasen <mclasen2redhat.com>
544177 - Fix trivial cut and paste error in documentation
diff --git a/gobject/gtype.c b/gobject/gtype.c
index 079d44ed7..4306332e7 100644
--- a/gobject/gtype.c
+++ b/gobject/gtype.c
@@ -2355,7 +2355,7 @@ g_type_register_fundamental (GType type_id,
if ((type_id & TYPE_ID_MASK) ||
type_id > G_TYPE_FUNDAMENTAL_MAX)
{
- g_warning ("attempt to register fundamental type `%s' with invalid type id (%zu)",
+ g_warning ("attempt to register fundamental type `%s' with invalid type id (%" G_TYPE_FORMAT ")",
type_name,
type_id);
return 0;
@@ -3937,7 +3937,7 @@ g_type_value_table_peek (GType type)
return vtable;
if (!node)
- g_warning (G_STRLOC ": type id `%zu' is invalid", type);
+ g_warning (G_STRLOC ": type id `%" G_TYPE_FORMAT "' is invalid", type);
if (!has_refed_data)
g_warning ("can't peek value table for type `%s' which is not currently referenced",
type_descriptive_name_I (type));
diff --git a/gobject/gtype.h b/gobject/gtype.h
index e2b3c7042..2988fb478 100644
--- a/gobject/gtype.h
+++ b/gobject/gtype.h
@@ -365,8 +365,10 @@ G_BEGIN_DECLS
*/
#if GLIB_SIZEOF_SIZE_T != GLIB_SIZEOF_LONG || !defined __cplusplus
typedef gsize GType;
+#define G_TYPE_FORMAT G_GSIZE_FORMAT
#else /* for historic reasons, C++ links against gulong GTypes */
typedef gulong GType;
+#define G_TYPE_FORMAT "lu"
#endif
typedef struct _GValue GValue;
typedef union _GTypeCValue GTypeCValue;