summaryrefslogtreecommitdiffstats
path: root/contrib/libobjc/objc
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/libobjc/objc')
-rw-r--r--contrib/libobjc/objc/NXConstStr.h16
-rw-r--r--contrib/libobjc/objc/Object.h16
-rw-r--r--contrib/libobjc/objc/Protocol.h17
-rw-r--r--contrib/libobjc/objc/encoding.h16
-rw-r--r--contrib/libobjc/objc/hash.h49
-rw-r--r--contrib/libobjc/objc/objc-api.h165
-rw-r--r--contrib/libobjc/objc/objc-decls.h47
-rw-r--r--contrib/libobjc/objc/objc-list.h13
-rw-r--r--contrib/libobjc/objc/objc.h8
-rw-r--r--contrib/libobjc/objc/runtime.h27
-rw-r--r--contrib/libobjc/objc/sarray.h19
-rw-r--r--contrib/libobjc/objc/thr.h16
-rw-r--r--contrib/libobjc/objc/typedstream.h21
13 files changed, 287 insertions, 143 deletions
diff --git a/contrib/libobjc/objc/NXConstStr.h b/contrib/libobjc/objc/NXConstStr.h
index f87c05e..3f408d3 100644
--- a/contrib/libobjc/objc/NXConstStr.h
+++ b/contrib/libobjc/objc/NXConstStr.h
@@ -1,5 +1,5 @@
/* Interface for the NXConstantString class for Objective-C.
- Copyright (C) 1995 Free Software Foundation, Inc.
+ Copyright (C) 1995, 2004 Free Software Foundation, Inc.
Contributed by Pieter J. Schoenmakers <tiggr@es.ele.tue.nl>
This file is part of GCC.
@@ -16,8 +16,8 @@ License for more details.
You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
+the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+Boston, MA 02110-1301, USA. */
/* As a special exception, if you link this library with files
compiled with GCC to produce an executable, this does not cause
@@ -28,7 +28,11 @@ Boston, MA 02111-1307, USA. */
#ifndef __nxconstantstring_INCLUDE_GNU
#define __nxconstantstring_INCLUDE_GNU
-#include "objc/Object.h"
+#include "Object.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
@interface NXConstantString: Object
{
@@ -41,4 +45,8 @@ Boston, MA 02111-1307, USA. */
@end
+#ifdef __cplusplus
+}
+#endif
+
#endif
diff --git a/contrib/libobjc/objc/Object.h b/contrib/libobjc/objc/Object.h
index ea3e7d7..7b67f46 100644
--- a/contrib/libobjc/objc/Object.h
+++ b/contrib/libobjc/objc/Object.h
@@ -15,8 +15,8 @@ License for more details.
You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
+the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+Boston, MA 02110-1301, USA. */
/* As a special exception, if you link this library with files compiled
with GCC to produce an executable, this does not cause the resulting
@@ -27,8 +27,12 @@ Boston, MA 02111-1307, USA. */
#ifndef __object_INCLUDE_GNU
#define __object_INCLUDE_GNU
-#include <objc/objc.h>
-#include <objc/typedstream.h>
+#include "objc.h"
+#include "typedstream.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
/*
* All classes are derived from Object. As such,
@@ -121,4 +125,8 @@ Boston, MA 02111-1307, USA. */
@end
+#ifdef __cplusplus
+}
+#endif
+
#endif
diff --git a/contrib/libobjc/objc/Protocol.h b/contrib/libobjc/objc/Protocol.h
index b39edf8..fe0f28a 100644
--- a/contrib/libobjc/objc/Protocol.h
+++ b/contrib/libobjc/objc/Protocol.h
@@ -1,5 +1,5 @@
/* Declare the class Protocol for Objective C programs.
- Copyright (C) 1993 Free Software Foundation, Inc.
+ Copyright (C) 1993, 2004 Free Software Foundation, Inc.
This file is part of GCC.
@@ -15,8 +15,8 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
+the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+Boston, MA 02110-1301, USA. */
/* As a special exception, if you link this library with files
compiled with GCC to produce an executable, this does not cause
@@ -27,7 +27,11 @@ Boston, MA 02111-1307, USA. */
#ifndef __Protocol_INCLUDE_GNU
#define __Protocol_INCLUDE_GNU
-#include "objc/Object.h"
+#include "Object.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
@interface Protocol : Object
{
@@ -52,7 +56,8 @@ Boston, MA 02111-1307, USA. */
@end
-
-
+#ifdef __cplusplus
+}
+#endif
#endif /* not __Protocol_INCLUDE_GNU */
diff --git a/contrib/libobjc/objc/encoding.h b/contrib/libobjc/objc/encoding.h
index 684d70d..c432ee9 100644
--- a/contrib/libobjc/objc/encoding.h
+++ b/contrib/libobjc/objc/encoding.h
@@ -1,5 +1,5 @@
/* Encoding of types for Objective C.
- Copyright (C) 1993, 1997, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1993, 1997, 2002, 2004 Free Software Foundation, Inc.
Author: Kresten Krab Thorup
@@ -17,8 +17,8 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
+the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+Boston, MA 02110-1301, USA. */
/* As a special exception, if you link this library with files
compiled with GCC to produce an executable, this does not cause
@@ -29,8 +29,12 @@ Boston, MA 02111-1307, USA. */
#ifndef __encoding_INCLUDE_GNU
#define __encoding_INCLUDE_GNU
+#include "objc-api.h"
#include <ctype.h>
-#include "objc/objc-api.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
#define _C_CONST 'r'
#define _C_IN 'n'
@@ -96,4 +100,8 @@ void objc_layout_structure_get_info (struct objc_struct_layout *layout,
unsigned int *align,
const char **type);
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
#endif /* __encoding_INCLUDE_GNU */
diff --git a/contrib/libobjc/objc/hash.h b/contrib/libobjc/objc/hash.h
index 02aca6e..b1cdd0c 100644
--- a/contrib/libobjc/objc/hash.h
+++ b/contrib/libobjc/objc/hash.h
@@ -1,5 +1,5 @@
/* Hash tables for Objective C method dispatch.
- Copyright (C) 1993, 1995, 1996 Free Software Foundation, Inc.
+ Copyright (C) 1993, 1995, 1996, 2004 Free Software Foundation, Inc.
This file is part of GCC.
@@ -15,8 +15,8 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
+the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+Boston, MA 02110-1301, USA. */
/* As a special exception, if you link this library with files
compiled with GCC to produce an executable, this does not cause
@@ -30,7 +30,11 @@ Boston, MA 02111-1307, USA. */
#include <stddef.h>
#include <string.h>
-#include <objc/objc.h>
+#include "objc.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
/*
* This data structure is used to hold items
@@ -58,7 +62,7 @@ typedef struct cache_node
*
* Unfortunately there is a mutual data structure reference problem with this
* typedef. Therefore, to remove compiler warnings the functions passed to
- * hash_new will have to be casted to this type.
+ * objc_hash_new will have to be casted to this type.
*/
typedef unsigned int (*hash_func_type) (void *, const void *);
@@ -107,25 +111,25 @@ extern cache_ptr module_hash_table, class_hash_table;
/* Allocate and initialize a hash table. */
-cache_ptr hash_new (unsigned int size,
- hash_func_type hash_func,
- compare_func_type compare_func);
+cache_ptr objc_hash_new (unsigned int size,
+ hash_func_type hash_func,
+ compare_func_type compare_func);
/* Deallocate all of the hash nodes and the cache itself. */
-void hash_delete (cache_ptr cache);
+void objc_hash_delete (cache_ptr cache);
/* Add the key/value pair to the hash table. If the
hash table reaches a level of fullness then it will be resized.
assert if the key is already in the hash. */
-void hash_add (cache_ptr *cachep, const void *key, void *value);
+void objc_hash_add (cache_ptr *cachep, const void *key, void *value);
/* Remove the key/value pair from the hash table.
assert if the key isn't in the table. */
-void hash_remove (cache_ptr cache, const void *key);
+void objc_hash_remove (cache_ptr cache, const void *key);
/* Used to index through the hash table. Start with NULL
to get the first entry.
@@ -136,15 +140,15 @@ void hash_remove (cache_ptr cache, const void *key);
Cache nodes are returned such that key or value can
be extracted. */
-node_ptr hash_next (cache_ptr cache, node_ptr node);
+node_ptr objc_hash_next (cache_ptr cache, node_ptr node);
/* Used to return a value from a hash table using a given key. */
-void *hash_value_for_key (cache_ptr cache, const void *key);
+void *objc_hash_value_for_key (cache_ptr cache, const void *key);
/* Used to determine if the given key exists in the hash table */
-BOOL hash_is_key_in_hash (cache_ptr cache, const void *key);
+BOOL objc_hash_is_key_in_hash (cache_ptr cache, const void *key);
/************************************************
@@ -159,7 +163,7 @@ BOOL hash_is_key_in_hash (cache_ptr cache, const void *key);
except for those likely to be 0 due to alignment.) */
static inline unsigned int
-hash_ptr (cache_ptr cache, const void *key)
+objc_hash_ptr (cache_ptr cache, const void *key)
{
return ((size_t)key / sizeof (void *)) & cache->mask;
}
@@ -168,11 +172,11 @@ hash_ptr (cache_ptr cache, const void *key)
/* Calculate a hash code by iterating over a NULL
terminate string. */
static inline unsigned int
-hash_string (cache_ptr cache, const void *key)
+objc_hash_string (cache_ptr cache, const void *key)
{
unsigned int ret = 0;
unsigned int ctr = 0;
- const char *ckey = key;
+ const char *ckey = (const char *) key;
while (*ckey) {
ret ^= *ckey++ << ctr;
@@ -185,7 +189,7 @@ hash_string (cache_ptr cache, const void *key)
/* Compare two pointers for equality. */
static inline int
-compare_ptrs (const void *k1, const void *k2)
+objc_compare_ptrs (const void *k1, const void *k2)
{
return (k1 == k2);
}
@@ -193,15 +197,20 @@ compare_ptrs (const void *k1, const void *k2)
/* Compare two strings. */
static inline int
-compare_strings (const void *k1, const void *k2)
+objc_compare_strings (const void *k1, const void *k2)
{
if (k1 == k2)
return 1;
else if (k1 == 0 || k2 == 0)
return 0;
else
- return ! strcmp (k1, k2);
+ return ! strcmp ((const char *) k1, (const char *) k2);
+}
+
+
+#ifdef __cplusplus
}
+#endif /* __cplusplus */
#endif /* not __hash_INCLUDE_GNU */
diff --git a/contrib/libobjc/objc/objc-api.h b/contrib/libobjc/objc/objc-api.h
index b50fa1b..e0e49e2 100644
--- a/contrib/libobjc/objc/objc-api.h
+++ b/contrib/libobjc/objc/objc-api.h
@@ -1,5 +1,5 @@
/* GNU Objective-C Runtime API.
- Copyright (C) 1993, 1995, 1996, 1997, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1993, 1995, 1996, 1997, 2002, 2004 Free Software Foundation, Inc.
This file is part of GCC.
@@ -15,8 +15,8 @@ License for more details.
You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
+the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+Boston, MA 02110-1301, USA. */
/* As a special exception, if you link this library with files compiled
with GCC to produce an executable, this does not cause the resulting
@@ -27,12 +27,17 @@ Boston, MA 02111-1307, USA. */
#ifndef __objc_api_INCLUDE_GNU
#define __objc_api_INCLUDE_GNU
-#include "objc/objc.h"
-#include "objc/hash.h"
-#include "objc/thr.h"
+#include "objc.h"
+#include "hash.h"
+#include "thr.h"
+#include "objc-decls.h"
#include <stdio.h>
#include <stdarg.h>
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
/* For functions which return Method_t */
#define METHOD_NULL (Method_t)0
/* Boolean typedefs */
@@ -64,6 +69,7 @@ struct objc_method_description
#define _C_FLT 'f'
#define _C_DBL 'd'
#define _C_BFLD 'b'
+#define _C_BOOL 'B'
#define _C_VOID 'v'
#define _C_UNDEF '?'
#define _C_PTR '^'
@@ -76,6 +82,7 @@ struct objc_method_description
#define _C_STRUCT_B '{'
#define _C_STRUCT_E '}'
#define _C_VECTOR '!'
+#define _C_COMPLEX 'j'
/*
@@ -100,7 +107,7 @@ struct objc_method_description
extern void objc_error(id object, int code, const char* fmt, ...);
extern void objc_verror(id object, int code, const char* fmt, va_list ap);
typedef BOOL (*objc_error_handler)(id, int code, const char *fmt, va_list ap);
-objc_error_handler objc_set_error_handler(objc_error_handler func);
+extern objc_error_handler objc_set_error_handler(objc_error_handler func);
/*
** Error codes
@@ -146,7 +153,11 @@ extern BOOL objc_trace;
struct objc_static_instances
{
char *class_name;
+#ifdef __cplusplus
+ id instances[1];
+#else
id instances[0];
+#endif
};
/*
@@ -204,14 +215,7 @@ typedef struct objc_module {
** The compiler generates one of these structures for a class that has
** instance variables defined in its specification.
*/
-typedef struct objc_ivar* Ivar_t;
-typedef struct objc_ivar_list {
- int ivar_count; /* Number of structures (Ivar)
- contained in the list. One
- structure per instance
- variable defined in the
- class. */
- struct objc_ivar {
+typedef struct objc_ivar {
const char* ivar_name; /* Name of the instance
variable as entered in the
class definition. */
@@ -221,8 +225,15 @@ typedef struct objc_ivar_list {
int ivar_offset; /* Byte offset from the base
address of the instance
structure to the variable. */
+} *Ivar_t;
- } ivar_list[1]; /* Variable length
+typedef struct objc_ivar_list {
+ int ivar_count; /* Number of structures (Ivar)
+ contained in the list. One
+ structure per instance
+ variable defined in the
+ class. */
+ struct objc_ivar ivar_list[1]; /* Variable length
structure. */
} IvarList, *IvarList_t;
@@ -235,28 +246,28 @@ typedef struct objc_ivar_list {
** and categories can break them across modules. To handle this problem is a
** singly linked list of methods.
*/
-typedef struct objc_method Method;
-typedef Method* Method_t;
+typedef struct objc_method {
+ SEL method_name; /* This variable is the method's
+ name. It is a char*.
+ The unique integer passed to
+ objc_msg_send is a char* too.
+ It is compared against
+ method_name using strcmp. */
+ const char* method_types; /* Description of the method's
+ parameter list. Useful for
+ debuggers. */
+ IMP method_imp; /* Address of the method in the
+ executable. */
+} Method, *Method_t;
+
typedef struct objc_method_list {
- struct objc_method_list* method_next; /* This variable is used to link
- a method list to another. It
- is a singly linked list. */
- int method_count; /* Number of methods defined in
- this structure. */
- struct objc_method {
- SEL method_name; /* This variable is the method's
- name. It is a char*.
- The unique integer passed to
- objc_msg_send is a char* too.
- It is compared against
- method_name using strcmp. */
- const char* method_types; /* Description of the method's
- parameter list. Useful for
- debuggers. */
- IMP method_imp; /* Address of the method in the
- executable. */
- } method_list[1]; /* Variable length
- structure. */
+ struct objc_method_list* method_next; /* This variable is used to link
+ a method list to another. It
+ is a singly linked list. */
+ int method_count; /* Number of methods defined in
+ this structure. */
+ Method method_list[1]; /* Variable length
+ structure. */
} MethodList, *MethodList_t;
struct objc_protocol_list {
@@ -342,7 +353,11 @@ typedef struct objc_category {
typedef struct objc_super {
id self; /* Id of the object sending
the message. */
+#ifdef __cplusplus
+ Class super_class;
+#else
Class class; /* Object's super class. */
+#endif
} Super, *Super_t;
IMP objc_msg_lookup_super(Super_t super, SEL sel);
@@ -357,7 +372,7 @@ retval_t objc_msg_sendv(id, SEL, arglist_t);
** This may e.g. try to load in the class using dynamic loading.
** The function is guaranteed to be passed a non-NULL name string.
*/
-extern Class (*_objc_lookup_class)(const char *name);
+objc_EXPORT Class (*_objc_lookup_class)(const char *name);
/*
** This is a hook which is called by __objc_exec_class every time a class
@@ -365,14 +380,14 @@ extern Class (*_objc_lookup_class)(const char *name);
** dynamic loader determine the classes that have been loaded when
** an object file is dynamically linked in.
*/
-extern void (*_objc_load_callback)(Class class, Category* category);
+objc_EXPORT void (*_objc_load_callback)(Class _class, Category* category);
/*
** Hook functions for allocating, copying and disposing of instances
*/
-extern id (*_objc_object_alloc)(Class class);
-extern id (*_objc_object_copy)(id object);
-extern id (*_objc_object_dispose)(id object);
+objc_EXPORT id (*_objc_object_alloc)(Class _class);
+objc_EXPORT id (*_objc_object_copy)(id object);
+objc_EXPORT id (*_objc_object_dispose)(id object);
/*
** Standard functions for memory allocation and disposal.
@@ -408,23 +423,23 @@ objc_free(void *mem);
** Users should call the normal objc routines above for
** memory allocation and disposal within their programs.
*/
-extern void *(*_objc_malloc)(size_t);
-extern void *(*_objc_atomic_malloc)(size_t);
-extern void *(*_objc_valloc)(size_t);
-extern void *(*_objc_realloc)(void *, size_t);
-extern void *(*_objc_calloc)(size_t, size_t);
-extern void (*_objc_free)(void *);
+objc_EXPORT void *(*_objc_malloc)(size_t);
+objc_EXPORT void *(*_objc_atomic_malloc)(size_t);
+objc_EXPORT void *(*_objc_valloc)(size_t);
+objc_EXPORT void *(*_objc_realloc)(void *, size_t);
+objc_EXPORT void *(*_objc_calloc)(size_t, size_t);
+objc_EXPORT void (*_objc_free)(void *);
/*
** Hook for method forwarding. This makes it easy to substitute a
** library, such as ffcall, that implements closures, thereby avoiding
** gcc's __builtin_apply problems.
*/
-extern IMP (*__objc_msg_forward)(SEL);
+objc_EXPORT IMP (*__objc_msg_forward)(SEL);
-Method_t class_get_class_method(MetaClass class, SEL aSel);
+Method_t class_get_class_method(MetaClass _class, SEL aSel);
-Method_t class_get_instance_method(Class class, SEL aSel);
+Method_t class_get_instance_method(Class _class, SEL aSel);
Class class_pose_as(Class impostor, Class superclass);
@@ -453,66 +468,66 @@ SEL sel_register_typed_name(const char *name, const char*type);
BOOL sel_is_mapped (SEL aSel);
-extern id class_create_instance(Class class);
+extern id class_create_instance(Class _class);
static inline const char *
-class_get_class_name(Class class)
+class_get_class_name(Class _class)
{
- return CLS_ISCLASS(class)?class->name:((class==Nil)?"Nil":0);
+ return CLS_ISCLASS(_class)?_class->name:((_class==Nil)?"Nil":0);
}
static inline long
-class_get_instance_size(Class class)
+class_get_instance_size(Class _class)
{
- return CLS_ISCLASS(class)?class->instance_size:0;
+ return CLS_ISCLASS(_class)?_class->instance_size:0;
}
static inline MetaClass
-class_get_meta_class(Class class)
+class_get_meta_class(Class _class)
{
- return CLS_ISCLASS(class)?class->class_pointer:Nil;
+ return CLS_ISCLASS(_class)?_class->class_pointer:Nil;
}
static inline Class
-class_get_super_class(Class class)
+class_get_super_class(Class _class)
{
- return CLS_ISCLASS(class)?class->super_class:Nil;
+ return CLS_ISCLASS(_class)?_class->super_class:Nil;
}
static inline int
-class_get_version(Class class)
+class_get_version(Class _class)
{
- return CLS_ISCLASS(class)?class->version:-1;
+ return CLS_ISCLASS(_class)?_class->version:-1;
}
static inline BOOL
-class_is_class(Class class)
+class_is_class(Class _class)
{
- return CLS_ISCLASS(class);
+ return CLS_ISCLASS(_class);
}
static inline BOOL
-class_is_meta_class(Class class)
+class_is_meta_class(Class _class)
{
- return CLS_ISMETA(class);
+ return CLS_ISMETA(_class);
}
static inline void
-class_set_version(Class class, long version)
+class_set_version(Class _class, long version)
{
- if (CLS_ISCLASS(class))
- class->version = version;
+ if (CLS_ISCLASS(_class))
+ _class->version = version;
}
static inline void *
-class_get_gc_object_type (Class class)
+class_get_gc_object_type (Class _class)
{
- return CLS_ISCLASS(class) ? class->gc_object_type : NULL;
+ return CLS_ISCLASS(_class) ? _class->gc_object_type : NULL;
}
/* Mark the instance variable as innaccessible to the garbage collector */
-extern void class_ivar_set_gcinvisible (Class class,
+extern void class_ivar_set_gcinvisible (Class _class,
const char* ivarname,
BOOL gcInvisible);
@@ -522,7 +537,7 @@ method_get_imp(Method_t method)
return (method!=METHOD_NULL)?method->method_imp:(IMP)0;
}
-IMP get_imp (Class class, SEL sel);
+IMP get_imp (Class _class, SEL sel);
/* Redefine on NeXTSTEP so as not to conflict with system function */
#ifdef __NeXT__
@@ -601,6 +616,10 @@ object_is_meta_class (id object)
struct sarray*
objc_get_uninstalled_dtable(void);
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
#endif /* not __objc_api_INCLUDE_GNU */
diff --git a/contrib/libobjc/objc/objc-decls.h b/contrib/libobjc/objc/objc-decls.h
new file mode 100644
index 0000000..52938a2
--- /dev/null
+++ b/contrib/libobjc/objc/objc-decls.h
@@ -0,0 +1,47 @@
+/* GNU Objective-C Extern helpers for Win32.
+ Copyright (C) 2004 Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by the
+Free Software Foundation; either version 2, or (at your option) any
+later version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
+License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING. If not, write to
+the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+Boston, MA 02110-1301, USA. */
+
+/* As a special exception, if you link this library with files compiled
+ with GCC to produce an executable, this does not cause the resulting
+ executable to be covered by the GNU General Public License. This
+ exception does not however invalidate any other reasons why the
+ executable file might be covered by the GNU General Public License. */
+
+#ifndef __objc_decls_INCLUDE_GNU
+#define __objc_decls_INCLUDE_GNU
+
+#if defined (_WIN32) || defined (__WIN32__) || defined (WIN32)
+
+# ifdef DLL_EXPORT /* defined by libtool (if required) */
+# define objc_EXPORT __declspec(dllexport)
+# define objc_DECLARE __declspec(dllexport)
+#else
+# define objc_EXPORT extern __declspec(dllimport)
+# define objc_DECLARE extern __declspec(dllimport)
+#endif
+
+#else
+
+# define objc_EXPORT extern
+# define objc_DECLARE
+
+#endif
+
+#endif /* __objc_decls_INCLUDE_GNU */
diff --git a/contrib/libobjc/objc/objc-list.h b/contrib/libobjc/objc/objc-list.h
index 06dbb39..051e1c2 100644
--- a/contrib/libobjc/objc/objc-list.h
+++ b/contrib/libobjc/objc/objc-list.h
@@ -16,8 +16,8 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
+the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+Boston, MA 02110-1301, USA. */
/* As a special exception, if you link this library with files compiled with
GCC to produce an executable, this does not cause the resulting executable
@@ -28,6 +28,10 @@ Boston, MA 02111-1307, USA. */
#ifndef __GNU_OBJC_LIST_H
#define __GNU_OBJC_LIST_H
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
struct objc_list {
void *head;
struct objc_list *tail;
@@ -144,4 +148,9 @@ list_free(struct objc_list* list)
objc_free(list);
}
}
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
#endif /* not __GNU_OBJC_LIST_H */
diff --git a/contrib/libobjc/objc/objc.h b/contrib/libobjc/objc/objc.h
index 3b57900..ee7612c 100644
--- a/contrib/libobjc/objc/objc.h
+++ b/contrib/libobjc/objc/objc.h
@@ -1,5 +1,5 @@
/* Basic data types for Objective C.
- Copyright (C) 1993, 1995, 1996 Free Software Foundation, Inc.
+ Copyright (C) 1993, 1995, 1996, 2004 Free Software Foundation, Inc.
This file is part of GCC.
@@ -15,8 +15,8 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
+the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+Boston, MA 02110-1301, USA. */
/* As a special exception, if you link this library with files
compiled with GCC to produce an executable, this does not cause
@@ -150,7 +150,7 @@ typedef struct objc_protocol {
typedef void* retval_t; /* return value */
typedef void(*apply_t)(void); /* function pointer */
-typedef union {
+typedef union arglist {
char *arg_ptr;
char arg_regs[sizeof (char*)];
} *arglist_t; /* argument frame */
diff --git a/contrib/libobjc/objc/runtime.h b/contrib/libobjc/objc/runtime.h
index 72e79be..3582d1d 100644
--- a/contrib/libobjc/objc/runtime.h
+++ b/contrib/libobjc/objc/runtime.h
@@ -1,5 +1,5 @@
/* GNU Objective C Runtime internal declarations
- Copyright (C) 1993, 1995, 1996, 1997, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1993, 1995, 1996, 1997, 2002, 2004 Free Software Foundation, Inc.
Contributed by Kresten Krab Thorup
This file is part of GCC.
@@ -15,7 +15,7 @@ details.
You should have received a copy of the GNU General Public License along with
GCC; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
/* As a special exception, if you link this library with files compiled with
GCC to produce an executable, this does not cause the resulting executable
@@ -32,15 +32,19 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include <ctype.h>
#include <stddef.h> /* so noone else will get system versions */
-#include "assert.h"
+#include <assert.h>
-#include "objc/objc.h" /* core data types */
-#include "objc/objc-api.h" /* runtime api functions */
+#include "objc.h" /* core data types */
+#include "objc-api.h" /* runtime api functions */
-#include "objc/thr.h" /* thread and mutex support */
+#include "thr.h" /* thread and mutex support */
-#include "objc/hash.h" /* hash structures */
-#include "objc/objc-list.h" /* linear lists */
+#include "hash.h" /* hash structures */
+#include "objc-list.h" /* linear lists */
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
extern void __objc_add_class_to_hash(Class); /* (objc-class.c) */
extern void __objc_init_selector_tables(void); /* (objc-sel.c) */
@@ -49,6 +53,7 @@ extern void __objc_init_dispatch_tables(void); /* (objc-dispatch.c) */
extern void __objc_install_premature_dtable(Class); /* (objc-dispatch.c) */
extern void __objc_resolve_class_links(void); /* (objc-class.c) */
extern void __objc_register_selectors_from_class(Class); /* (objc-sel.c) */
+extern void __objc_register_selectors_from_list (MethodList_t); /* (selector.c) */
extern void __objc_update_dispatch_table_for_class (Class);/* (objc-msg.c) */
extern int __objc_init_thread_system(void); /* thread.c */
@@ -84,6 +89,8 @@ SEL __sel_register_typed_name (const char*, const char*,
struct objc_selector*, BOOL is_const);
extern void __objc_generate_gc_type_description (Class);
-#endif /* not __objc_runtime_INCLUDE_GNU */
-
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+#endif /* not __objc_runtime_INCLUDE_GNU */
diff --git a/contrib/libobjc/objc/sarray.h b/contrib/libobjc/objc/sarray.h
index a94a98a..fe66b2e 100644
--- a/contrib/libobjc/objc/sarray.h
+++ b/contrib/libobjc/objc/sarray.h
@@ -1,5 +1,5 @@
/* Sparse Arrays for Objective C dispatch tables
- Copyright (C) 1993, 1995, 1996 Free Software Foundation, Inc.
+ Copyright (C) 1993, 1995, 1996, 2004 Free Software Foundation, Inc.
Contributed by Kresten Krab Thorup.
This file is part of GCC.
@@ -16,8 +16,8 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
+the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+Boston, MA 02110-1301, USA. */
/* As a special exception, if you link this library with files
compiled with GCC to produce an executable, this does not cause
@@ -28,6 +28,8 @@ Boston, MA 02111-1307, USA. */
#ifndef __sarray_INCLUDE_GNU
#define __sarray_INCLUDE_GNU
+#include "thr.h"
+
#define OBJC_SPARSE2 /* 2-level sparse array */
/* #define OBJC_SPARSE3 */ /* 3-level sparse array */
@@ -40,16 +42,17 @@ extern const char* __objc_sparse3_id;
#endif
#include <stddef.h>
+#include <assert.h>
-#include "objc/thr.h"
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
extern int nbuckets; /* for stats */
extern int nindices;
extern int narrays;
extern int idxsize;
-#include <assert.h>
-
/* An unsigned integer of same size as a pointer */
#define SIZET_BITS (sizeof(size_t)*8)
@@ -234,4 +237,8 @@ static inline void* sarray_get_safe(struct sarray* array, sidx indx)
return (array->empty_bucket->elems[0]);
}
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
#endif /* __sarray_INCLUDE_GNU */
diff --git a/contrib/libobjc/objc/thr.h b/contrib/libobjc/objc/thr.h
index 1178f2e..c139926 100644
--- a/contrib/libobjc/objc/thr.h
+++ b/contrib/libobjc/objc/thr.h
@@ -1,5 +1,5 @@
/* Thread and mutex controls for Objective C.
- Copyright (C) 1996, 1997, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1996, 1997, 2002, 2004 Free Software Foundation, Inc.
Contributed by Galen C. Hunt (gchunt@cs.rochester.edu)
This file is part of GCC.
@@ -25,8 +25,8 @@ details.
You should have received a copy of the GNU General Public License along with
GCC; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin Street, Fifth Floor,
+Boston, MA 02110-1301, USA. */
/* As a special exception, if you link this library with files
compiled with GCC to produce an executable, this does not cause
@@ -38,7 +38,11 @@ Boston, MA 02111-1307, USA. */
#ifndef __thread_INCLUDE_GNU
#define __thread_INCLUDE_GNU
-#include "objc/objc.h"
+#include "objc.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
/*************************************************************************
* Universal static variables:
@@ -142,4 +146,8 @@ objc_thread_t __objc_thread_id (void);
int __objc_thread_set_data (void *value);
void * __objc_thread_get_data (void);
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
#endif /* not __thread_INCLUDE_GNU */
diff --git a/contrib/libobjc/objc/typedstream.h b/contrib/libobjc/objc/typedstream.h
index ed78bf7..3a5e0b3 100644
--- a/contrib/libobjc/objc/typedstream.h
+++ b/contrib/libobjc/objc/typedstream.h
@@ -1,5 +1,5 @@
/* GNU Objective-C Typed Streams interface.
- Copyright (C) 1993, 1995 Free Software Foundation, Inc.
+ Copyright (C) 1993, 1995, 2004 Free Software Foundation, Inc.
This file is part of GCC.
@@ -15,8 +15,8 @@ License for more details.
You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
+the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+Boston, MA 02110-1301, USA. */
/* As a special exception, if you link this library with files compiled
with GCC to produce an executable, this does not cause the resulting
@@ -27,10 +27,15 @@ Boston, MA 02111-1307, USA. */
#ifndef __typedstream_INCLUDE_GNU
#define __typedstream_INCLUDE_GNU
-#include "objc/objc.h"
-#include "objc/hash.h"
+#include "objc.h"
+#include "hash.h"
+
#include <stdio.h>
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
typedef int (*objc_typed_read_func)(void*, char*, int);
typedef int (*objc_typed_write_func)(void*, const char*, int);
typedef int (*objc_typed_flush_func)(void*);
@@ -99,7 +104,7 @@ int objc_read_types (TypedStream* stream, const char* type, ...);
int objc_write_object_reference (TypedStream* stream, id object);
int objc_write_root_object (TypedStream* stream, id object);
-long objc_get_stream_class_version (TypedStream* stream, Class class);
+long objc_get_stream_class_version (TypedStream* stream, Class class_type);
/*
@@ -129,4 +134,8 @@ void objc_close_typed_stream (TypedStream* stream);
BOOL objc_end_of_typed_stream (TypedStream* stream);
void objc_flush_typed_stream (TypedStream* stream);
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
#endif /* not __typedstream_INCLUDE_GNU */
OpenPOWER on IntegriCloud