simplify header layout

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@32545 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
rfm 2011-03-13 12:52:37 +00:00
parent a02864b726
commit de2378bc87
58 changed files with 6221 additions and 5613 deletions

View file

@ -212,7 +212,7 @@ Base_AGSDOC_FLAGS = \
BaseAdditions_AGSDOC_FLAGS = \
-MakeFrames YES \
-DocumentationDirectory ../Documentation/BaseAdditions \
-HeaderDirectory ../Headers/Additions/GNUstepBase \
-HeaderDirectory ../Headers/GNUstepBase \
-Declared GNUstepBase \
-Standards YES \
-DTDs ../Tools \

View file

@ -64,11 +64,16 @@ ifneq ($(base),no)
LIBRARY_NAME += libgnustep-base
endif
OBJECTIVEC2_HEADERS =
ifeq ($(OBJC2RUNTIME),0)
libgnustep-base_SUBPROJECTS = ObjectiveC2
OBJECTIVEC2_HEADERS += \
Availability.h blocks_runtime.h capabilities.h runtime.h
else
ifeq ($(HAVE_BLOCKS),0)
libgnustep-base_SUBPROJECTS = ObjectiveC2
OBJECTIVEC2_HEADERS += blocks_runtime.h
endif
endif
@ -107,7 +112,7 @@ win32-entry.m \
win32-def.top \
libgnustep-base.def
ADD_HEADERS = \
GNUSTEPBASE_HEADERS = \
GSBlocks.h \
GSVersionMacros.h \
GSObjCRuntime.h \
@ -144,7 +149,6 @@ GNUstep.h \
preface.h \
Additions.h
GNU_HEADERS = $(ADD_HEADERS)
# GNUStep source files
@ -444,8 +448,10 @@ NSXMLNodeOptions.h \
NSXMLParser.h \
NSZone.h
HEADERS_INSTALL = $(GNU_HEADERS) \
$(FOUNDATION_HEADERS)
HEADERS_INSTALL = \
$(OBJECTIVEC2_HEADERS) \
$(GNUSTEPBASE_HEADERS) \
$(FOUNDATION_HEADERS)
GENERATED_HFILES = \
dynamic-load.h \

View file

@ -50,8 +50,12 @@ after-all:: Info-gnustep.plist
# to the source we must install the GNU header manually
# Ayers 2003-07-31: This statement should be reevaluated!
after-install::
for file in $(GNU_HEADERS); do \
$(INSTALL_DATA) ../Headers/Additions/GNUstepBase/$$file \
for file in $(OBJECTIVEC2_HEADERS); do \
$(INSTALL_DATA) ../Headers/ObjectiveC2/$$file \
$(GNUSTEP_HEADERS)/ObjectiveC2/$$file ; \
done
for file in $(GNUSTEPBASE_HEADERS); do \
$(INSTALL_DATA) ../Headers/GNUstepBase/$$file \
$(GNUSTEP_HEADERS)/GNUstepBase/$$file ; \
done
$(MKDIRS) $(GNUSTEP_HEADERS)/$(GNUSTEP_TARGET_DIR)/GNUstepBase
@ -78,7 +82,10 @@ after-install::
# Things to do after uninstalling
before-uninstall::
for file in $(GNU_HEADERS); do \
for file in $(OBJECTIVEC2_HEADERS); do \
rm -f $(GNUSTEP_HEADERS)/ObjectiveC2/$$file ; \
done
for file in $(GNUSTEPBASE_HEADERS); do \
rm -f $(GNUSTEP_HEADERS)/GNUstepBase/$$file ; \
done
rm -f $(GNUSTEP_HEADERS)/$(GNUSTEP_TARGET_DIR)/GNUstepBase/GSConfig.h

View file

@ -63,7 +63,6 @@ ADDITIONAL_CPPFLAGS = $(DEFS) $(CONFIG_SYSTEM_DEFS) $(WARN_FLAGS) \
# Additional include directories the compiler should search
ADDITIONAL_INCLUDE_DIRS = \
-I../Headers/Additions \
-I../Headers \
-I./$(GNUSTEP_TARGET_DIR)
@ -88,6 +87,6 @@ ADDITIONAL_INSTALL_DIRS = $(GNUSTEP_HEADERS)/Foundation \
$(GNUSTEP_HEADERS)/GNUstepBase/unicode \
$(GNUSTEP_HEADERS)/$(GNUSTEP_TARGET_DIR)
HEADER_DIR_BASE = ../Headers/Additions/GNUstepBase
HEADER_DIR_BASE = ../Headers/GNUstepBase
HEADER_DIR_FND = ../Headers/Foundation

View file

@ -1,19 +0,0 @@
#ifdef STRICT_MACOS_X
# define OBJC_NONPORTABLE __attribute__((error("Function not supported by the Apple runtime")))
#else
# define OBJC_NONPORTABLE
#endif
#if !defined(OBJC_DEPRECATED)
# if !defined(__DEPRECATE_DIRECT_ACCESS) || defined(__OBJC_LEGACY_GNU_MODE__) || defined(__OBJC_RUNTIME_INTERNAL__)
# define OBJC_DEPRECATED
# else
# if ((__GNUC__ > 3) || (__GNUC__ == 3 && __GNUC_MINOR >= 1))
# define OBJC_DEPRECATED __attribute__((deprecated))
# else
# define OBJC_DEPRECATED
# endif
# endif
#endif

View file

@ -33,7 +33,6 @@ SUBPROJECT_NAME = ObjectiveC2
ObjectiveC2_C_FILES =
ObjectiveC2_OBJC_FILES =
ObjectiveC2_HEADER_FILES =
ifeq ($(OBJC2RUNTIME),0)
@ -47,11 +46,6 @@ endif
ObjectiveC2_C_FILES += caps.c runtime.c
ObjectiveC2_HEADER_FILES += \
Availability.h\
capabilities.h\
runtime.h
endif
ifeq ($(HAVE_BLOCKS),0)
@ -60,9 +54,6 @@ ObjectiveC2_OBJC_FILES += \
blocks_runtime.m\
NSBlocks.m
ObjectiveC2_HEADER_FILES += \
blocks_runtime.h
endif
ifeq ($(CC), clang)

View file

@ -1,5 +1,5 @@
#import <objc/objc-api.h>
#import "blocks_runtime.h"
#import "ObjectiveC2/blocks_runtime.h"
#include <assert.h>
struct objc_class _NSConcreteGlobalBlock;

View file

@ -1,17 +0,0 @@
/*
* Blocks Runtime
*/
#include "ObjectiveC2/Availability.h"
#ifdef __cplusplus
#define BLOCKS_EXPORT extern "C"
#else
#define BLOCKS_EXPORT extern
#endif
BLOCKS_EXPORT void *_Block_copy(void *);
BLOCKS_EXPORT void _Block_release(void *);
BLOCKS_EXPORT const char *_Block_get_types(void*) OBJC_NONPORTABLE;
#define Block_copy(x) ((__typeof(x))_Block_copy((void *)(x)))
#define Block_release(x) _Block_release((void *)(x))

View file

@ -1,71 +0,0 @@
/**
* capabilities.h - This file defines the list of capabilities. Runtime
* capabilities can be checked. You may use #ifdef to test at compile time
* whether the runtime on the current platform understands the capability.
* This does not mean that the runtime implements the capability, however.
*
* A copy of this file exists for compatibility in GNUstep's Objective-C
* framework. When using this framework in conjunction with the GNU
* Objective-C runtime, most of the features will not be supported at run time,
* even if the corresponding macros are available at compile time.
* Additionally, several are compile-time options in the GNUstep runtime, so
* although they are present in the header and understood by the runtime, they
* may not be supported by the installed runtime.
*/
/**
* The runtime supports zero-cost exceptions.
*/
#define OBJC_CAP_EXCEPTIONS 0
/**
* The runtime supports the @synchronize directive.
*/
#define OBJC_CAP_SYNCRONIZE 1
/**
* The runtime supports property accessors.
*/
#define OBJC_CAP_PROPERTIES 2
/**
* The runtime supports introspection on declared properties.
*/
#define OBJC_CAP_PROPERTY_INTROSPECTION 3
/**
* The runtime supports optional methods and declared properties in protocols.
*/
#define OBJC_CAP_OPTIONAL_PROTOCOLS 4
/**
* The runtime supports non-fragile instance variables.
*/
#define OBJC_CAP_NONFRAGILE_IVARS 5
/**
* The runtime supports making method lookup dependent on the types, as well as
* the name, of the selector.
*/
#define OBJC_CAP_TYPE_DEPENDENT_DISPATCH 6
/**
* The runtime was compiled in the low-memory profile. This trades some speed
* for reduced memory consumption.
*/
#define OBJC_CAP_LOW_MEMORY 7
/**
* Macro used to require the existence of a specific capability. This creates
* a function that is called by the loader and tests that the runtime supports
* the required capability, aborting if it does not.
*/
#define OBJC_REQUIRE_CAPABILITY(x) \
__attribute__((constructor)) static void objc_test ## x(void)\
{\
if (!objc_test_capability(x))\
{\
fprintf(stderr, "Runtime does not support required property: " #x "\n");\
exit(1);\
}\
}
/**
* Run time feature test. This function returns 1 if the runtime supports the
* specified feature or 0 if it does not.
*/
int objc_test_capability(int x);

View file

@ -1,4 +1,4 @@
#include "capabilities.h"
#include "ObjectiveC2/capabilities.h"
#include <stdint.h>
/**

View file

@ -1,300 +0,0 @@
#ifndef __OBJECTIVEC2_RUNTIME_H_INCLUDED__
#define __OBJECTIVEC2_RUNTIME_H_INCLUDED__
#include <stdint.h>
#include <stddef.h>
#include <sys/types.h>
#include "ObjectiveC2/Availability.h"
#if defined(ERROR_UNSUPPORTED_RUNTIME_FUNCTIONS)
# define OBJC_GNU_RUNTIME_UNSUPPORTED(x) \
__attribute__((error(x " not supported by the GNU runtime")))
#else
# define OBJC_GNU_RUNTIME_UNSUPPORTED(x)
#endif
#if !defined(OBJC_DEPRECATED)
# if !defined(__DEPRECATE_DIRECT_ACCESS) || defined(__OBJC_LEGACY_GNU_MODE__) || defined(__OBJC_RUNTIME_INTERNAL__)
# define OBJC_DEPRECATED
# else
# if ((__GNUC__ > 3) || (__GNUC__ == 3 && __GNUC_MINOR >= 1))
# define OBJC_DEPRECATED __attribute__((deprecated))
# else
# define OBJC_DEPRECATED
# endif
# endif
#endif
// Undo GNUstep substitutions
#ifdef class_setVersion
#undef class_setVersion
#endif
#ifdef class_getClassMethod
#undef class_getClassMethod
#endif
#ifdef objc_getClass
#undef objc_getClass
#endif
#ifdef objc_lookUpClass
#undef objc_lookUpClass
#endif
typedef struct objc_ivar* Ivar;
#ifndef __objc_INCLUDE_GNU
typedef const struct objc_selector *SEL;
typedef struct objc_class *Class;
typedef struct objc_object
{
Class isa;
} *id;
struct objc_super {
id receiver;
# if !defined(__cplusplus) && !__OBJC2__
Class class;
# else
Class super_class;
# endif
};
typedef id (*IMP)(id, SEL, ...);
typedef struct objc_method *Method;
# ifdef STRICT_APPLE_COMPATIBILITY
typedef signed char BOOL;
# else
# ifdef __vxwords
typedef int BOOL
# else
typedef unsigned char BOOL;
# endif
# endif
#else
// Method in the GNU runtime is a struct, Method_t is the pointer
# define Method Method_t
#endif // __objc_INCLUDE_GNU
typedef void *objc_property_t;
#ifdef __OBJC__
@class Protocol;
#else
typedef struct objc_protocol Protocol;
#endif
#ifndef YES
#define YES ((BOOL)1)
#endif
#ifndef NO
#define NO ((BOOL)0)
#endif
#ifdef __GNUC
#define _OBJC_NULL_PTR __null
#elif defined(__cplusplus)
#define _OBJC_NULL_PTR 0
#else
#define _OBJC_NULL_PTR ((void*)0)
#endif
#ifndef nil
#define nil ((id)_OBJC_NULL_PTR)
#endif
#ifndef Nil
#define Nil ((Class)_OBJC_NULL_PTR)
#endif
BOOL class_addIvar(Class cls,
const char *name,
size_t size,
uint8_t alignment,
const char *types);
BOOL class_addMethod(Class cls, SEL name, IMP imp, const char *types);
BOOL class_addProtocol(Class cls, Protocol *protocol);
BOOL class_conformsToProtocol(Class cls, Protocol *protocol);
Ivar * class_copyIvarList(Class cls, unsigned int *outCount);
Method * class_copyMethodList(Class cls, unsigned int *outCount);
OBJC_GNU_RUNTIME_UNSUPPORTED("Property introspection")
objc_property_t * class_copyPropertyList(Class cls, unsigned int *outCount);
Protocol ** class_copyProtocolList(Class cls, unsigned int *outCount);
id class_createInstance(Class cls, size_t extraBytes);
Method class_getClassMethod(Class aClass, SEL aSelector);
Ivar class_getClassVariable(Class cls, const char* name);
Method class_getInstanceMethod(Class aClass, SEL aSelector);
size_t class_getInstanceSize(Class cls);
Ivar class_getInstanceVariable(Class cls, const char* name);
const char *class_getIvarLayout(Class cls);
IMP class_getMethodImplementation(Class cls, SEL name);
IMP class_getMethodImplementation_stret(Class cls, SEL name);
const char * class_getName(Class cls);
OBJC_GNU_RUNTIME_UNSUPPORTED("Property introspection")
objc_property_t class_getProperty(Class cls, const char *name);
Class class_getSuperclass(Class cls);
int class_getVersion(Class theClass);
OBJC_GNU_RUNTIME_UNSUPPORTED("Weak instance variables")
const char *class_getWeakIvarLayout(Class cls);
BOOL class_isMetaClass(Class cls);
IMP class_replaceMethod(Class cls, SEL name, IMP imp, const char *types);
BOOL class_respondsToSelector(Class cls, SEL sel);
void class_setIvarLayout(Class cls, const char *layout);
OBJC_DEPRECATED
Class class_setSuperclass(Class cls, Class newSuper);
void class_setVersion(Class theClass, int version);
OBJC_GNU_RUNTIME_UNSUPPORTED("Weak instance variables")
void class_setWeakIvarLayout(Class cls, const char *layout);
const char * ivar_getName(Ivar ivar);
ptrdiff_t ivar_getOffset(Ivar ivar);
const char * ivar_getTypeEncoding(Ivar ivar);
char * method_copyArgumentType(Method method, unsigned int index);
char * method_copyReturnType(Method method);
void method_exchangeImplementations(Method m1, Method m2);
void method_getArgumentType(Method method, unsigned int index, char *dst, size_t dst_len);
IMP method_getImplementation(Method method);
SEL method_getName(Method method);
unsigned method_getNumberOfArguments(Method method);
void method_getReturnType(Method method, char *dst, size_t dst_len);
const char * method_getTypeEncoding(Method method);
IMP method_setImplementation(Method method, IMP imp);
Class
objc_allocateClassPair(Class superclass, const char *name, size_t extraBytes);
OBJC_NONPORTABLE
Class objc_allocateMetaClass(Class superclass, size_t extraBytes);
void objc_disposeClassPair(Class cls);
id objc_getClass(const char *name);
int objc_getClassList(Class *buffer, int bufferLen);
id objc_getMetaClass(const char *name);
id objc_getRequiredClass(const char *name);
id objc_lookUpClass(const char *name);
Class objc_allocateClassPair(Class superclass, const char *name, size_t extraBytes);
Protocol *objc_getProtocol(const char *name);
void objc_registerClassPair(Class cls);
void *object_getIndexedIvars(id obj);
// FIXME: The GNU runtime has a version of this which omits the size parameter
//id object_copy(id obj, size_t size);
id object_dispose(id obj);
Class object_getClass(id obj);
Class object_setClass(id obj, Class cls);
const char *object_getClassName(id obj);
IMP objc_msg_lookup(id, SEL);
IMP objc_msg_lookup_super(struct objc_super*, SEL);
OBJC_GNU_RUNTIME_UNSUPPORTED("Protocol introspection")
Protocol **objc_copyProtocolList(unsigned int *count);
BOOL protocol_conformsToProtocol(Protocol *p, Protocol *other);
struct objc_method_description *protocol_copyMethodDescriptionList(Protocol *p,
BOOL isRequiredMethod, BOOL isInstanceMethod, unsigned int *count);
OBJC_GNU_RUNTIME_UNSUPPORTED("Protocol introspection")
objc_property_t *protocol_copyPropertyList(Protocol *p, unsigned int *count);
Protocol **protocol_copyProtocolList(Protocol *p, unsigned int *count);
struct objc_method_description protocol_getMethodDescription(Protocol *p,
SEL aSel, BOOL isRequiredMethod, BOOL isInstanceMethod);
const char *protocol_getName(Protocol *p);
OBJC_GNU_RUNTIME_UNSUPPORTED("Protocol introspection")
objc_property_t protocol_getProperty(Protocol *p, const char *name,
BOOL isRequiredProperty, BOOL isInstanceProperty);
BOOL protocol_isEqual(Protocol *p, Protocol *other);
// Only enable support for object planes when
// -fobjc-sender-dependent-dispatch is specified
#ifdef __OBJC_SENDER_AWARE_DISPATCH__
// Global self so that self is a valid symbol everywhere. Will be replaced by
// a real self in an inner scope if there is one.
static const id self = nil;
#define objc_msgSend(theReceiver, theSelector, ...) objc_msg_lookup_sender(theReceiver, theSelector, self)(theReceiver, theSelector, ## __VA_ARGS__)
#endif
#if (GCC_VERSION >= 3000)
#define objc_msgSend(theReceiver, theSelector, ...) objc_msg_lookup(theReceiver, theSelector)(theReceiver, theSelector, ## __VA_ARGS__)
#define objc_msgSendSuper(super, op, ...) objc_msg_lookup_super(super, op)(super->receiver, op, ## __VA_ARGS__)
#else /* GCC_VERSION >= 3000 */
#define objc_msgSend(theReceiver, theSelector, args...) objc_msg_lookup(theReceiver, theSelector)(theReceiver, theSelector, args)
#define objc_msgSendSuper(super, op, args...) objc_msg_lookup_super(super, op)(super->receiver, op, args)
#endif /* GCC_VERSION >= 3000 */
const char *sel_getName(SEL sel);
SEL sel_getUid(const char *selName);
BOOL sel_isEqual(SEL sel1, SEL sel2);
SEL sel_registerName(const char *selName);
#endif // __OBJECTIVEC2_RUNTIME_H_INCLUDED