From c2740ba8d066f2612f6bc821961ce00857ea29c5 Mon Sep 17 00:00:00 2001 From: pinskia Date: Fri, 25 Jun 2004 04:31:51 +0000 Subject: [PATCH 1/1] 2004-06-24 Andrew Pinski * objc/encoding.h: Wrap the functions with extern "C" for C++ mode. * objc/hash.h: Likewise. * objc/objc-api.h: Likewise. * objc/objc-list.h: Likewise. * objc/runtime.h: Likewise. * objc/sarray.h: Likewise. * objc/thr.h: Likewise. * objc/typedstream.h: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@83635 138bc75d-0d04-0410-961f-82ee72b054a4 --- libobjc/ChangeLog | 13 +++++++++++++ libobjc/objc/encoding.h | 8 ++++++++ libobjc/objc/hash.h | 9 +++++++++ libobjc/objc/objc-api.h | 10 ++++++++++ libobjc/objc/objc-list.h | 11 +++++++++++ libobjc/objc/runtime.h | 10 ++++++++++ libobjc/objc/sarray.h | 18 ++++++++++++++++++ libobjc/objc/thr.h | 9 +++++++++ libobjc/objc/typedstream.h | 10 ++++++++++ 9 files changed, 98 insertions(+) diff --git a/libobjc/ChangeLog b/libobjc/ChangeLog index 619683259e8..3e8c9564d14 100644 --- a/libobjc/ChangeLog +++ b/libobjc/ChangeLog @@ -1,3 +1,16 @@ +2004-06-24 Andrew Pinski + + * objc/encoding.h: Wrap the functions with extern "C" for C++ + mode. + * objc/hash.h: Likewise. + * objc/objc-api.h: Likewise. + * objc/objc-list.h: Likewise. + * objc/runtime.h: Likewise. + * objc/sarray.h: Likewise. + * objc/thr.h: Likewise. + * objc/typedstream.h: Likewise. + + 2004-06-21 Nick Clifton * encoding.c (BITS_PER_UNIT): Define if a definition is not diff --git a/libobjc/objc/encoding.h b/libobjc/objc/encoding.h index 684d70d0fdc..b6287fc77b8 100644 --- a/libobjc/objc/encoding.h +++ b/libobjc/objc/encoding.h @@ -32,6 +32,10 @@ Boston, MA 02111-1307, USA. */ #include #include "objc/objc-api.h" +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + #define _C_CONST 'r' #define _C_IN 'n' #define _C_INOUT '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/libobjc/objc/hash.h b/libobjc/objc/hash.h index 4c545315acf..47715af26b0 100644 --- a/libobjc/objc/hash.h +++ b/libobjc/objc/hash.h @@ -32,6 +32,11 @@ Boston, MA 02111-1307, USA. */ #include #include +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + + /* * This data structure is used to hold items * stored in a hash table. Each node holds @@ -203,5 +208,9 @@ compare_strings (const void *k1, const void *k2) return ! strcmp ((const char *) k1, (const char *) k2); } +#ifdef __cplusplus +} +#endif /* __cplusplus */ + #endif /* not __hash_INCLUDE_GNU */ diff --git a/libobjc/objc/objc-api.h b/libobjc/objc/objc-api.h index 52ad50a1213..03bbe666c66 100644 --- a/libobjc/objc/objc-api.h +++ b/libobjc/objc/objc-api.h @@ -34,6 +34,11 @@ Boston, MA 02111-1307, USA. */ #include #include +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + + /* For functions which return Method_t */ #define METHOD_NULL (Method_t)0 /* Boolean typedefs */ @@ -606,6 +611,11 @@ 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/libobjc/objc/objc-list.h b/libobjc/objc/objc-list.h index 06dbb39fbcc..866095dabd4 100644 --- a/libobjc/objc/objc-list.h +++ b/libobjc/objc/objc-list.h @@ -28,6 +28,11 @@ 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 +149,10 @@ list_free(struct objc_list* list) objc_free(list); } } + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + + #endif /* not __GNU_OBJC_LIST_H */ diff --git a/libobjc/objc/runtime.h b/libobjc/objc/runtime.h index 17a3e5e9e76..d4179f2d3da 100644 --- a/libobjc/objc/runtime.h +++ b/libobjc/objc/runtime.h @@ -42,6 +42,11 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "objc/hash.h" /* hash structures */ #include "objc/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) */ extern void __objc_init_class_tables(void); /* (objc-class.c) */ @@ -85,6 +90,11 @@ SEL __sel_register_typed_name (const char*, const char*, struct objc_selector*, BOOL is_const); extern void __objc_generate_gc_type_description (Class); +#ifdef __cplusplus +} +#endif /* __cplusplus */ + + #endif /* not __objc_runtime_INCLUDE_GNU */ diff --git a/libobjc/objc/sarray.h b/libobjc/objc/sarray.h index a94a98ac5a1..5956a43071e 100644 --- a/libobjc/objc/sarray.h +++ b/libobjc/objc/sarray.h @@ -43,11 +43,20 @@ extern const char* __objc_sparse3_id; #include "objc/thr.h" +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + extern int nbuckets; /* for stats */ extern int nindices; extern int narrays; extern int idxsize; +#ifdef __cplusplus +} +#endif /* __cplusplus */ + + #include /* An unsigned integer of same size as a pointer */ @@ -142,6 +151,10 @@ struct sarray { size_t capacity; }; +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + struct sarray* sarray_new(int, void* default_element); void sarray_free(struct sarray*); struct sarray* sarray_lazy_copy(struct sarray*); @@ -234,4 +247,9 @@ 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/libobjc/objc/thr.h b/libobjc/objc/thr.h index 1178f2ed743..b4472fefd82 100644 --- a/libobjc/objc/thr.h +++ b/libobjc/objc/thr.h @@ -40,6 +40,10 @@ Boston, MA 02111-1307, USA. */ #include "objc/objc.h" +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + /************************************************************************* * Universal static variables: */ @@ -142,4 +146,9 @@ 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/libobjc/objc/typedstream.h b/libobjc/objc/typedstream.h index 48456a6381d..8e9e2e39f2e 100644 --- a/libobjc/objc/typedstream.h +++ b/libobjc/objc/typedstream.h @@ -31,6 +31,11 @@ Boston, MA 02111-1307, USA. */ #include "objc/hash.h" #include +#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*); @@ -129,4 +134,9 @@ 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 */ -- 2.11.0