another attempted workaround for __block issue

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@34036 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2011-10-20 09:52:01 +00:00
parent 4d2b2b728e
commit ad461bf00b
2 changed files with 18 additions and 9 deletions

View file

@ -1,3 +1,7 @@
2011-10-20 Richard Frith-Macdonald <rfm@gnu.org>
* Source/common.h: Attempt to workaroiund clang __blockproblem
2011-10-20 Richard Frith-Macdonald <rfm@gnu.org>
* Source/NSPathUtilities.m:

View file

@ -48,16 +48,21 @@
#import "GNUstepBase/NSBundle+GNUstepBase.h"
/* We need to wrap unistd.h because it is used throughout the code and some
* versions include __block as a variable name, and clang now defines that
* as a reserved word :-(
* versions include __block as a variable name, and clang also defines that
* and depends on the definition later ... so we resort to the fragile hack
* of redefining according to the observed definition.
*/
#ifdef HAVE_UNISTD_H
#ifdef __block
/* Turn off Clang built-in __block */
#undef __block
#endif
#define __block __gs_unistd_block
#include <unistd.h>
#undef __block
# ifdef __block
# undef __block
# define __block __gs_unistd_block
# include <unistd.h>
# undef __block
# define __block __attribute__((__blocks__(byref)))
# endif
#else
# define __block __gs_unistd_block
# include <unistd.h>
# undef __block
#endif