Fixup for usage with flag to turn off typeof()

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@25363 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2007-07-31 12:09:42 +00:00
parent 6a7732579b
commit 3e17a107ae
7 changed files with 25 additions and 12 deletions

View file

@ -1,3 +1,15 @@
2007-07-31 Richard Frith-Macdonald <rfm@gnu.org>
* Headers/Foundation/NSRange.h:
* Headers/Foundation/NSException.h:
* Headers/Foundation/NSGeometry.h:
* Headers/Foundation/NSAutoreleasePool.h:
* Headers/Additions/GNUstepBase/preface.h.in:
* macosx/GNUstepBase/preface.h:
Use __typeof__ rather than typeof so that if the header is included
in user code which is compiled with a flag to disalow typeof, the
code will still work.
2007-07-25 Fred Kiefer <FredKiefer@gmx.de>
* Headers/Foundation/NSErrorRecoveryAttempting.h: Add new file.

View file

@ -112,19 +112,19 @@
#ifndef MAX
#define MAX(a,b) \
({typeof(a) _MAX_a = (a); typeof(b) _MAX_b = (b); \
({__typeof__(a) _MAX_a = (a); __typeof__(b) _MAX_b = (b); \
_MAX_a > _MAX_b ? _MAX_a : _MAX_b; })
#endif
#ifndef MIN
#define MIN(a,b) \
({typeof(a) _MIN_a = (a); typeof(b) _MIN_b = (b); \
({__typeof__(a) _MIN_a = (a); __typeof__(b) _MIN_b = (b); \
_MIN_a < _MIN_b ? _MIN_a : _MIN_b; })
#endif
#ifndef ABS
#define ABS(a) \
({typeof(a) _ABS_a = (a); \
({__typeof__(a) _ABS_a = (a); \
_ABS_a < 0 ? -_ABS_a : _ABS_a; })
#endif

View file

@ -70,7 +70,8 @@ typedef struct autorelease_thread_vars
/* Initialize an autorelease_thread_vars structure for a new thread.
This function is called in NSThread each time an NSThread is created.
TV should be of type `struct autorelease_thread_vars *' */
#define init_autorelease_thread_vars(TV) memset (TV, 0, sizeof (typeof (*TV)))
#define init_autorelease_thread_vars(TV) \
memset (TV, 0, sizeof (__typeof__ (*TV)))

View file

@ -304,7 +304,7 @@ GS_EXPORT void _NSRemoveHandler( NSHandler *handler );
#define NS_ENDHANDLER }}}
#define NS_VALRETURN(val) do { typeof(val) temp = (val); \
#define NS_VALRETURN(val) do { __typeof__(val) temp = (val); \
_NSRemoveHandler(&NSLocalHandler); \
return(temp); } while (0)

View file

@ -38,14 +38,14 @@ extern "C" {
#ifndef MAX
#define MAX(a,b) \
({typeof(a) _MAX_a = (a); typeof(b) _MAX_b = (b); \
({__typeof__(a) _MAX_a = (a); __typeof__(b) _MAX_b = (b); \
_MAX_a > _MAX_b ? _MAX_a : _MAX_b; })
#define GS_DEFINED_MAX
#endif
#ifndef MIN
#define MIN(a,b) \
({typeof(a) _MIN_a = (a); typeof(b) _MIN_b = (b); \
({__typeof__(a) _MIN_a = (a); __typeof__(b) _MIN_b = (b); \
_MIN_a < _MIN_b ? _MIN_a : _MIN_b; })
#define GS_DEFINED_MIN
#endif

View file

@ -41,14 +41,14 @@ extern "C" {
#ifndef MAX
#define MAX(a,b) \
({typeof(a) _MAX_a = (a); typeof(b) _MAX_b = (b); \
({__typeof__(a) _MAX_a = (a); __typeof__(b) _MAX_b = (b); \
_MAX_a > _MAX_b ? _MAX_a : _MAX_b; })
#define GS_DEFINED_MAX
#endif
#ifndef MIN
#define MIN(a,b) \
({typeof(a) _MIN_a = (a); typeof(b) _MIN_b = (b); \
({__typeof__(a) _MIN_a = (a); __typeof__(b) _MIN_b = (b); \
_MIN_a < _MIN_b ? _MIN_a : _MIN_b; })
#define GS_DEFINED_MIN
#endif

View file

@ -119,19 +119,19 @@ extern const char o_NeXT_cc_version[];
#ifndef MAX
#define MAX(a,b) \
({typeof(a) _MAX_a = (a); typeof(b) _MAX_b = (b); \
({__typeof__(a) _MAX_a = (a); __typeof__(b) _MAX_b = (b); \
_MAX_a > _MAX_b ? _MAX_a : _MAX_b; })
#endif
#ifndef MIN
#define MIN(a,b) \
({typeof(a) _MIN_a = (a); typeof(b) _MIN_b = (b); \
({__typeof__(a) _MIN_a = (a); __typeof__(b) _MIN_b = (b); \
_MIN_a < _MIN_b ? _MIN_a : _MIN_b; })
#endif
#ifndef ABS
#define ABS(a) \
({typeof(a) _ABS_a = (a); \
({__typeof__(a) _ABS_a = (a); \
_ABS_a < 0 ? -_ABS_a : _ABS_a; })
#endif