mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 16:30:41 +00:00
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:
parent
ba1232afff
commit
51d3096c8b
2 changed files with 18 additions and 9 deletions
|
@ -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>
|
2011-10-20 Richard Frith-Macdonald <rfm@gnu.org>
|
||||||
|
|
||||||
* Source/NSPathUtilities.m:
|
* Source/NSPathUtilities.m:
|
||||||
|
|
|
@ -48,16 +48,21 @@
|
||||||
#import "GNUstepBase/NSBundle+GNUstepBase.h"
|
#import "GNUstepBase/NSBundle+GNUstepBase.h"
|
||||||
|
|
||||||
/* We need to wrap unistd.h because it is used throughout the code and some
|
/* 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
|
* versions include __block as a variable name, and clang also defines that
|
||||||
* as a reserved word :-(
|
* 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 HAVE_UNISTD_H
|
||||||
#ifdef __block
|
# ifdef __block
|
||||||
/* Turn off Clang built-in __block */
|
# undef __block
|
||||||
#undef __block
|
# define __block __gs_unistd_block
|
||||||
#endif
|
# include <unistd.h>
|
||||||
#define __block __gs_unistd_block
|
# undef __block
|
||||||
#include <unistd.h>
|
# define __block __attribute__((__blocks__(byref)))
|
||||||
#undef __block
|
# endif
|
||||||
|
#else
|
||||||
|
# define __block __gs_unistd_block
|
||||||
|
# include <unistd.h>
|
||||||
|
# undef __block
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue