diff --git a/Source/Additions/NSThread+GNUstepBase.m b/Source/Additions/NSThread+GNUstepBase.m index acd041329..690b544f0 100644 --- a/Source/Additions/NSThread+GNUstepBase.m +++ b/Source/Additions/NSThread+GNUstepBase.m @@ -26,7 +26,7 @@ #import "common.h" #import "Foundation/NSThread.h" -#if defined(__APPLE__) +#if defined(NeXT_Foundation_LIBRARY) /* These functions are in NSThread.m in the base library. */ diff --git a/Source/Additions/Unicode.m b/Source/Additions/Unicode.m index ebae453a7..baf86dd20 100644 --- a/Source/Additions/Unicode.m +++ b/Source/Additions/Unicode.m @@ -29,7 +29,9 @@ */ #import "common.h" -#ifndef NeXT_Foundation_LIBRARY +#if defined(NeXT_Foundation_LIBRARY) +#import +#else #import "Foundation/NSArray.h" #import "Foundation/NSBundle.h" #import "Foundation/NSDictionary.h" @@ -37,8 +39,6 @@ #import "Foundation/NSException.h" #import "Foundation/NSLock.h" #import "Foundation/NSPathUtilities.h" -#else -#import #endif #import "GNUstepBase/GSLock.h" diff --git a/Source/common.h b/Source/common.h index 48f7f07ec..63f6d02d1 100644 --- a/Source/common.h +++ b/Source/common.h @@ -6,6 +6,14 @@ #import "config.h" +/* If this is included in a file in the Additions subdirectory, and we are + * building for use with the NeXT/Apple Foundation, then we need to import + * the native headers in preference to any of our own. + */ +#if defined(NeXT_Foundation_LIBRARY) +#import +#endif + /* GNUstepBase/GSConfig.h includes so * we import local versions first. */