From 430ae18e5be4267c00ea38542d885642f35e6714 Mon Sep 17 00:00:00 2001 From: Havoc Pennington Date: Fri, 1 Dec 2000 05:42:51 +0000 Subject: [PATCH] Provide G_CONST_RETURN which is 'const' by default, and nothing when 2000-11-21 Havoc Pennington * gmacros.h: Provide G_CONST_RETURN which is 'const' by default, and nothing when G_DISABLE_CONST_RETURNS is defined. --- ChangeLog | 9 +++++++-- ChangeLog.pre-2-0 | 9 +++++++-- ChangeLog.pre-2-10 | 9 +++++++-- ChangeLog.pre-2-12 | 9 +++++++-- ChangeLog.pre-2-2 | 9 +++++++-- ChangeLog.pre-2-4 | 9 +++++++-- ChangeLog.pre-2-6 | 9 +++++++-- ChangeLog.pre-2-8 | 9 +++++++-- glib/gmacros.h | 10 ++++++++++ gmacros.h | 10 ++++++++++ 10 files changed, 76 insertions(+), 16 deletions(-) diff --git a/ChangeLog b/ChangeLog index ceda10b..72f049d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2000-11-21 Havoc Pennington + + * 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 * 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 * gthread.h: Add void in empty function arg list diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index ceda10b..72f049d 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,8 @@ +2000-11-21 Havoc Pennington + + * 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 * 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 * gthread.h: Add void in empty function arg list diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index ceda10b..72f049d 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,8 @@ +2000-11-21 Havoc Pennington + + * 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 * 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 * gthread.h: Add void in empty function arg list diff --git a/ChangeLog.pre-2-12 b/ChangeLog.pre-2-12 index ceda10b..72f049d 100644 --- a/ChangeLog.pre-2-12 +++ b/ChangeLog.pre-2-12 @@ -1,3 +1,8 @@ +2000-11-21 Havoc Pennington + + * 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 * 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 * gthread.h: Add void in empty function arg list diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index ceda10b..72f049d 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,8 @@ +2000-11-21 Havoc Pennington + + * 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 * 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 * gthread.h: Add void in empty function arg list diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index ceda10b..72f049d 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,8 @@ +2000-11-21 Havoc Pennington + + * 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 * 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 * gthread.h: Add void in empty function arg list diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index ceda10b..72f049d 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,8 @@ +2000-11-21 Havoc Pennington + + * 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 * 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 * gthread.h: Add void in empty function arg list diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index ceda10b..72f049d 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,8 @@ +2000-11-21 Havoc Pennington + + * 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 * 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 * gthread.h: Add void in empty function arg list diff --git a/glib/gmacros.h b/glib/gmacros.h index 7033766..633d7fa 100644 --- a/glib/gmacros.h +++ b/glib/gmacros.h @@ -175,4 +175,14 @@ # 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__ */ diff --git a/gmacros.h b/gmacros.h index 7033766..633d7fa 100644 --- a/gmacros.h +++ b/gmacros.h @@ -175,4 +175,14 @@ # 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__ */ -- 2.7.4