mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 16:33:29 +00:00
provide gcc 2.95 variadic macro
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@29485 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
85ec0e519b
commit
fb3ec312b6
1 changed files with 19 additions and 0 deletions
|
@ -19,6 +19,9 @@ typedef retTy(^name)(argTys, ## __VA_ARGS__)
|
|||
/* Fall-back versions for when the compiler doesn't have native blocks support.
|
||||
*/
|
||||
#else
|
||||
|
||||
#if (GCC_VERSION >= 3000)
|
||||
|
||||
#define DEFINE_BLOCK_TYPE(name, retTy, argTys, ...) \
|
||||
typedef struct {\
|
||||
void *isa;\
|
||||
|
@ -28,5 +31,21 @@ typedef retTy(^name)(argTys, ## __VA_ARGS__)
|
|||
} *name
|
||||
#define CALL_BLOCK(block, args, ...) \
|
||||
block->invoke(block, args, ## __VA_ARGS__)
|
||||
|
||||
#else /* GCC_VERSION >= 3000 */
|
||||
|
||||
#define DEFINE_BLOCK_TYPE(name, retTy, argTys, args...) \
|
||||
typedef struct {\
|
||||
void *isa;\
|
||||
int flags;\
|
||||
int reserved;\
|
||||
retTy (*invoke)(void*, argTys, args);\
|
||||
} *name
|
||||
#define CALL_BLOCK(block, args...) \
|
||||
block->invoke(block, args)
|
||||
|
||||
|
||||
#endif /* GCC_VERSION >= 3000 */
|
||||
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Reference in a new issue