Provide G_CONST_RETURN which is 'const' by default, and nothing when

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.
This commit is contained in:
Havoc Pennington
2000-12-01 05:42:51 +00:00
committed by Havoc Pennington
parent 5495142560
commit 430ae18e5b
10 changed files with 76 additions and 16 deletions

View File

@@ -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__ */