mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-26 18:21:04 +00:00
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@35503 72102866-910b-0410-8b05-ffd578937521
100 lines
2.9 KiB
Objective-C
100 lines
2.9 KiB
Objective-C
/* Header file for all objective-c code in the base library.
|
|
* This imports all the common headers in a consistent order such that
|
|
* we can be sure only local headers are used rather than any which
|
|
* might be from an earlier build.
|
|
*/
|
|
|
|
/* disable extensions ... we want to use standard code
|
|
*/
|
|
#ifdef _GNU_SOURCE
|
|
#undef _GNU_SOURCE
|
|
#endif
|
|
|
|
/* Ensure we have _XOPEN_SOURCE turned on at the appropriate
|
|
* level for the facilities we need.
|
|
*
|
|
* Minimum of 600 for string.h so we get the POSIX strerror_r() behavior
|
|
*/
|
|
/* This hack work around for glibc breaks FreeBSD and probably other platforms.
|
|
*/
|
|
#if (defined(__linux__) &&!defined(__GNU__)) || defined(__QNXNTO__)
|
|
# if defined(_XOPEN_SOURCE)
|
|
# if _XOPEN_SOURCE < 600
|
|
# undef _XOPEN_SOURCE
|
|
# define _XOPEN_SOURCE 600
|
|
# endif
|
|
# else
|
|
# define _XOPEN_SOURCE 600
|
|
# endif
|
|
#endif
|
|
|
|
#import "config.h"
|
|
|
|
#if defined(HAVE_STRING_H)
|
|
/* For POSIX strerror_r() and others
|
|
*/
|
|
#include <string.h>
|
|
#endif
|
|
|
|
#include <errno.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 <Foundation/Foundation.h>
|
|
#endif
|
|
|
|
#import "GNUstepBase/GSConfig.h"
|
|
|
|
/* Set localisation macro for use within the base library itsself.
|
|
*/
|
|
#define GS_LOCALISATION_BUNDLE \
|
|
[NSBundle bundleForLibrary: @"gnustep-base" version: \
|
|
OBJC_STRINGIFY(GNUSTEP_BASE_MAJOR_VERSION.GNUSTEP_BASE_MINOR_VERSION)]
|
|
|
|
#import "GNUstepBase/GNUstep.h"
|
|
|
|
/* Foundation/NSObject.h imports <Foundation/NSZone.h> and
|
|
* <Foundation/NSObjCRuntime.h> so we import local versions first.
|
|
*/
|
|
#import "Foundation/NSZone.h"
|
|
#import "Foundation/NSObjCRuntime.h"
|
|
|
|
/* Almost all headers import <Foundation/NSObject.h> so we import
|
|
* "Foundation/NSObject.h" first, to ensure we have a local copy.
|
|
*/
|
|
#import "Foundation/NSObject.h"
|
|
|
|
/* These headers are used in almost every file.
|
|
*/
|
|
#import "Foundation/NSString.h"
|
|
#import "Foundation/NSDebug.h"
|
|
|
|
/* These headers needed for string localisation ... hopefully we will
|
|
* localise all the exceptions and debug/error messages in all the source
|
|
* some day, so localisation needs ot be in the common header for all code.
|
|
*/
|
|
#import "Foundation/NSBundle.h"
|
|
#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 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
|
|
# undef __block
|
|
# define __block __gs_unistd_block
|
|
# include <unistd.h>
|
|
# undef __block
|
|
# define __block __attribute__((__blocks__(byref)))
|
|
# else
|
|
# define __block __gs_unistd_block
|
|
# include <unistd.h>
|
|
# undef __block
|
|
# endif
|
|
#endif
|
|
|