mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 16:33:29 +00:00
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:
parent
6a7732579b
commit
3e17a107ae
7 changed files with 25 additions and 12 deletions
12
ChangeLog
12
ChangeLog
|
@ -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.
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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)))
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue