Provide G_CONST_RETURN which is 'const' by default, and nothing when
authorHavoc Pennington <hp@pobox.com>
Fri, 1 Dec 2000 05:42:51 +0000 (05:42 +0000)
committerHavoc Pennington <hp@src.gnome.org>
Fri, 1 Dec 2000 05:42:51 +0000 (05:42 +0000)
2000-11-21  Havoc Pennington  <hp@pobox.com>

* gmacros.h: Provide G_CONST_RETURN which is 'const' by default,
and nothing when G_DISABLE_CONST_RETURNS is defined.

ChangeLog
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-12
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
glib/gmacros.h
gmacros.h

index ceda10b..72f049d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2000-11-21  Havoc Pennington  <hp@pobox.com>
+
+       * gmacros.h: Provide G_CONST_RETURN which is 'const' by default,
+       and nothing when G_DISABLE_CONST_RETURNS is defined.
+
 2000-11-29  Havoc Pennington  <hp@redhat.com>
 
        * gunidecomp.c (COMBINING_CLASS): s/UNICODE_LAST_CHAR/G_UNICODE_LAST_CHAR/
@@ -54,8 +59,8 @@
        * gthread.h: Do only show the location of the locking/unlocking
        for -DG_ERRORCHECK_MUTEXES and not the name of the mutex. Add the
        errorcheck capability for g_cond_wait and g_cond_timed_wait as
-       well.
-       
+       well.   
+
 2000-11-27  Havoc Pennington  <hp@redhat.com>
 
        * gthread.h: Add void in empty function arg list
index ceda10b..72f049d 100644 (file)
@@ -1,3 +1,8 @@
+2000-11-21  Havoc Pennington  <hp@pobox.com>
+
+       * gmacros.h: Provide G_CONST_RETURN which is 'const' by default,
+       and nothing when G_DISABLE_CONST_RETURNS is defined.
+
 2000-11-29  Havoc Pennington  <hp@redhat.com>
 
        * gunidecomp.c (COMBINING_CLASS): s/UNICODE_LAST_CHAR/G_UNICODE_LAST_CHAR/
@@ -54,8 +59,8 @@
        * gthread.h: Do only show the location of the locking/unlocking
        for -DG_ERRORCHECK_MUTEXES and not the name of the mutex. Add the
        errorcheck capability for g_cond_wait and g_cond_timed_wait as
-       well.
-       
+       well.   
+
 2000-11-27  Havoc Pennington  <hp@redhat.com>
 
        * gthread.h: Add void in empty function arg list
index ceda10b..72f049d 100644 (file)
@@ -1,3 +1,8 @@
+2000-11-21  Havoc Pennington  <hp@pobox.com>
+
+       * gmacros.h: Provide G_CONST_RETURN which is 'const' by default,
+       and nothing when G_DISABLE_CONST_RETURNS is defined.
+
 2000-11-29  Havoc Pennington  <hp@redhat.com>
 
        * gunidecomp.c (COMBINING_CLASS): s/UNICODE_LAST_CHAR/G_UNICODE_LAST_CHAR/
@@ -54,8 +59,8 @@
        * gthread.h: Do only show the location of the locking/unlocking
        for -DG_ERRORCHECK_MUTEXES and not the name of the mutex. Add the
        errorcheck capability for g_cond_wait and g_cond_timed_wait as
-       well.
-       
+       well.   
+
 2000-11-27  Havoc Pennington  <hp@redhat.com>
 
        * gthread.h: Add void in empty function arg list
index ceda10b..72f049d 100644 (file)
@@ -1,3 +1,8 @@
+2000-11-21  Havoc Pennington  <hp@pobox.com>
+
+       * gmacros.h: Provide G_CONST_RETURN which is 'const' by default,
+       and nothing when G_DISABLE_CONST_RETURNS is defined.
+
 2000-11-29  Havoc Pennington  <hp@redhat.com>
 
        * gunidecomp.c (COMBINING_CLASS): s/UNICODE_LAST_CHAR/G_UNICODE_LAST_CHAR/
@@ -54,8 +59,8 @@
        * gthread.h: Do only show the location of the locking/unlocking
        for -DG_ERRORCHECK_MUTEXES and not the name of the mutex. Add the
        errorcheck capability for g_cond_wait and g_cond_timed_wait as
-       well.
-       
+       well.   
+
 2000-11-27  Havoc Pennington  <hp@redhat.com>
 
        * gthread.h: Add void in empty function arg list
index ceda10b..72f049d 100644 (file)
@@ -1,3 +1,8 @@
+2000-11-21  Havoc Pennington  <hp@pobox.com>
+
+       * gmacros.h: Provide G_CONST_RETURN which is 'const' by default,
+       and nothing when G_DISABLE_CONST_RETURNS is defined.
+
 2000-11-29  Havoc Pennington  <hp@redhat.com>
 
        * gunidecomp.c (COMBINING_CLASS): s/UNICODE_LAST_CHAR/G_UNICODE_LAST_CHAR/
@@ -54,8 +59,8 @@
        * gthread.h: Do only show the location of the locking/unlocking
        for -DG_ERRORCHECK_MUTEXES and not the name of the mutex. Add the
        errorcheck capability for g_cond_wait and g_cond_timed_wait as
-       well.
-       
+       well.   
+
 2000-11-27  Havoc Pennington  <hp@redhat.com>
 
        * gthread.h: Add void in empty function arg list
index ceda10b..72f049d 100644 (file)
@@ -1,3 +1,8 @@
+2000-11-21  Havoc Pennington  <hp@pobox.com>
+
+       * gmacros.h: Provide G_CONST_RETURN which is 'const' by default,
+       and nothing when G_DISABLE_CONST_RETURNS is defined.
+
 2000-11-29  Havoc Pennington  <hp@redhat.com>
 
        * gunidecomp.c (COMBINING_CLASS): s/UNICODE_LAST_CHAR/G_UNICODE_LAST_CHAR/
@@ -54,8 +59,8 @@
        * gthread.h: Do only show the location of the locking/unlocking
        for -DG_ERRORCHECK_MUTEXES and not the name of the mutex. Add the
        errorcheck capability for g_cond_wait and g_cond_timed_wait as
-       well.
-       
+       well.   
+
 2000-11-27  Havoc Pennington  <hp@redhat.com>
 
        * gthread.h: Add void in empty function arg list
index ceda10b..72f049d 100644 (file)
@@ -1,3 +1,8 @@
+2000-11-21  Havoc Pennington  <hp@pobox.com>
+
+       * gmacros.h: Provide G_CONST_RETURN which is 'const' by default,
+       and nothing when G_DISABLE_CONST_RETURNS is defined.
+
 2000-11-29  Havoc Pennington  <hp@redhat.com>
 
        * gunidecomp.c (COMBINING_CLASS): s/UNICODE_LAST_CHAR/G_UNICODE_LAST_CHAR/
@@ -54,8 +59,8 @@
        * gthread.h: Do only show the location of the locking/unlocking
        for -DG_ERRORCHECK_MUTEXES and not the name of the mutex. Add the
        errorcheck capability for g_cond_wait and g_cond_timed_wait as
-       well.
-       
+       well.   
+
 2000-11-27  Havoc Pennington  <hp@redhat.com>
 
        * gthread.h: Add void in empty function arg list
index ceda10b..72f049d 100644 (file)
@@ -1,3 +1,8 @@
+2000-11-21  Havoc Pennington  <hp@pobox.com>
+
+       * gmacros.h: Provide G_CONST_RETURN which is 'const' by default,
+       and nothing when G_DISABLE_CONST_RETURNS is defined.
+
 2000-11-29  Havoc Pennington  <hp@redhat.com>
 
        * gunidecomp.c (COMBINING_CLASS): s/UNICODE_LAST_CHAR/G_UNICODE_LAST_CHAR/
@@ -54,8 +59,8 @@
        * gthread.h: Do only show the location of the locking/unlocking
        for -DG_ERRORCHECK_MUTEXES and not the name of the mutex. Add the
        errorcheck capability for g_cond_wait and g_cond_timed_wait as
-       well.
-       
+       well.   
+
 2000-11-27  Havoc Pennington  <hp@redhat.com>
 
        * gthread.h: Add void in empty function arg list
index 7033766..633d7fa 100644 (file)
 #  endif
 #endif
 
+/* Allow the app programmer to select whether or not return values
+ * (usually char*) are const or not.  Don't try using this feature for
+ * functions with C++ linkage.
+ */
+#ifdef G_DISABLE_CONST_RETURNS
+#define G_CONST_RETURN
+#else
+#define G_CONST_RETURN const
+#endif
+
 #endif /* __G_MACROS_H__ */
index 7033766..633d7fa 100644 (file)
--- a/gmacros.h
+++ b/gmacros.h
 #  endif
 #endif
 
+/* Allow the app programmer to select whether or not return values
+ * (usually char*) are const or not.  Don't try using this feature for
+ * functions with C++ linkage.
+ */
+#ifdef G_DISABLE_CONST_RETURNS
+#define G_CONST_RETURN
+#else
+#define G_CONST_RETURN const
+#endif
+
 #endif /* __G_MACROS_H__ */