From 9a65b20e0761d000fd357218a92d09f4910f9d73 Mon Sep 17 00:00:00 2001 From: Tim Janik Date: Thu, 14 Oct 1999 22:04:24 +0000 Subject: [PATCH] removed useless g_string(x) macro that cluttered the namespace and was Tue Oct 12 14:17:12 1999 Tim Janik * glib.h: removed useless g_string(x) macro that cluttered the namespace and was just a poor wrapper around the cpp '#' symbol, use #x if you need to work around this. added new macro G_STRINGIFY(arg) that will convert arg to a string, no matter whether it contains macros or not. --- ChangeLog | 8 ++++++++ ChangeLog.pre-2-0 | 8 ++++++++ ChangeLog.pre-2-10 | 8 ++++++++ ChangeLog.pre-2-12 | 8 ++++++++ ChangeLog.pre-2-2 | 8 ++++++++ ChangeLog.pre-2-4 | 8 ++++++++ ChangeLog.pre-2-6 | 8 ++++++++ ChangeLog.pre-2-8 | 8 ++++++++ NEWS | 3 ++- glib.h | 6 +++--- glib/glib.h | 6 +++--- 11 files changed, 72 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0d4652a..5502212 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +Tue Oct 12 14:17:12 1999 Tim Janik + + * glib.h: removed useless g_string(x) macro that cluttered the namespace + and was just a poor wrapper around the cpp '#' symbol, use #x if you + need to work around this. + added new macro G_STRINGIFY(arg) that will convert arg to a string, + no matter whether it contains macros or not. + 1999-10-12 Tor Lillqvist * config.h.win32.in: Define the new GLIB_SIZEOF_* constants here, diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index 0d4652a..5502212 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,11 @@ +Tue Oct 12 14:17:12 1999 Tim Janik + + * glib.h: removed useless g_string(x) macro that cluttered the namespace + and was just a poor wrapper around the cpp '#' symbol, use #x if you + need to work around this. + added new macro G_STRINGIFY(arg) that will convert arg to a string, + no matter whether it contains macros or not. + 1999-10-12 Tor Lillqvist * config.h.win32.in: Define the new GLIB_SIZEOF_* constants here, diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 0d4652a..5502212 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,11 @@ +Tue Oct 12 14:17:12 1999 Tim Janik + + * glib.h: removed useless g_string(x) macro that cluttered the namespace + and was just a poor wrapper around the cpp '#' symbol, use #x if you + need to work around this. + added new macro G_STRINGIFY(arg) that will convert arg to a string, + no matter whether it contains macros or not. + 1999-10-12 Tor Lillqvist * config.h.win32.in: Define the new GLIB_SIZEOF_* constants here, diff --git a/ChangeLog.pre-2-12 b/ChangeLog.pre-2-12 index 0d4652a..5502212 100644 --- a/ChangeLog.pre-2-12 +++ b/ChangeLog.pre-2-12 @@ -1,3 +1,11 @@ +Tue Oct 12 14:17:12 1999 Tim Janik + + * glib.h: removed useless g_string(x) macro that cluttered the namespace + and was just a poor wrapper around the cpp '#' symbol, use #x if you + need to work around this. + added new macro G_STRINGIFY(arg) that will convert arg to a string, + no matter whether it contains macros or not. + 1999-10-12 Tor Lillqvist * config.h.win32.in: Define the new GLIB_SIZEOF_* constants here, diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index 0d4652a..5502212 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,11 @@ +Tue Oct 12 14:17:12 1999 Tim Janik + + * glib.h: removed useless g_string(x) macro that cluttered the namespace + and was just a poor wrapper around the cpp '#' symbol, use #x if you + need to work around this. + added new macro G_STRINGIFY(arg) that will convert arg to a string, + no matter whether it contains macros or not. + 1999-10-12 Tor Lillqvist * config.h.win32.in: Define the new GLIB_SIZEOF_* constants here, diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 0d4652a..5502212 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,11 @@ +Tue Oct 12 14:17:12 1999 Tim Janik + + * glib.h: removed useless g_string(x) macro that cluttered the namespace + and was just a poor wrapper around the cpp '#' symbol, use #x if you + need to work around this. + added new macro G_STRINGIFY(arg) that will convert arg to a string, + no matter whether it contains macros or not. + 1999-10-12 Tor Lillqvist * config.h.win32.in: Define the new GLIB_SIZEOF_* constants here, diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 0d4652a..5502212 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,11 @@ +Tue Oct 12 14:17:12 1999 Tim Janik + + * glib.h: removed useless g_string(x) macro that cluttered the namespace + and was just a poor wrapper around the cpp '#' symbol, use #x if you + need to work around this. + added new macro G_STRINGIFY(arg) that will convert arg to a string, + no matter whether it contains macros or not. + 1999-10-12 Tor Lillqvist * config.h.win32.in: Define the new GLIB_SIZEOF_* constants here, diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 0d4652a..5502212 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,11 @@ +Tue Oct 12 14:17:12 1999 Tim Janik + + * glib.h: removed useless g_string(x) macro that cluttered the namespace + and was just a poor wrapper around the cpp '#' symbol, use #x if you + need to work around this. + added new macro G_STRINGIFY(arg) that will convert arg to a string, + no matter whether it contains macros or not. + 1999-10-12 Tor Lillqvist * config.h.win32.in: Define the new GLIB_SIZEOF_* constants here, diff --git a/NEWS b/NEWS index 18531dc..022acd5 100644 --- a/NEWS +++ b/NEWS @@ -13,7 +13,8 @@ What's new in GLib 1.3.1: * New thread-safe random number generator Mersenne Twister. * g_strcompress() added, g_strescape() had a slight API change, and more tightly defined semantics. - +* the g_string(x) macro has been removed, #x may be used instead. + Overview of Changes in GLib 1.2.1: * g_realloc() fix for SunOS (please report further problems). diff --git a/glib.h b/glib.h index 1eac04a..d88cef6 100644 --- a/glib.h +++ b/glib.h @@ -131,6 +131,9 @@ extern "C" { #undef CLAMP #define CLAMP(x, low, high) (((x) > (high)) ? (high) : (((x) < (low)) ? (low) : (x))) +#define G_STRINGIFY(macro_or_string) G_STRINGIFY_ARG (macro_or_string) +#define G_STRINGIFY_ARG(contents) #contents + /* Define G_VA_COPY() to do the right thing for copying va_list variables. * glibconfig.h may have already defined G_VA_COPY as va_copy or __va_copy. @@ -326,9 +329,6 @@ extern "C" { } G_STMT_END -#define g_string(x) #x - - /* Provide macros for error handling. The "assert" macros will * exit on failure. The "return" macros will exit the current * function. Two different definitions are given for the macros diff --git a/glib/glib.h b/glib/glib.h index 1eac04a..d88cef6 100644 --- a/glib/glib.h +++ b/glib/glib.h @@ -131,6 +131,9 @@ extern "C" { #undef CLAMP #define CLAMP(x, low, high) (((x) > (high)) ? (high) : (((x) < (low)) ? (low) : (x))) +#define G_STRINGIFY(macro_or_string) G_STRINGIFY_ARG (macro_or_string) +#define G_STRINGIFY_ARG(contents) #contents + /* Define G_VA_COPY() to do the right thing for copying va_list variables. * glibconfig.h may have already defined G_VA_COPY as va_copy or __va_copy. @@ -326,9 +329,6 @@ extern "C" { } G_STMT_END -#define g_string(x) #x - - /* Provide macros for error handling. The "assert" macros will * exit on failure. The "return" macros will exit the current * function. Two different definitions are given for the macros -- 2.7.4