Skip to content

Commit

Permalink
Wrap some headers in extern C for C++ compat.
Browse files Browse the repository at this point in the history
  • Loading branch information
DHowett committed Jan 22, 2018
1 parent b6099e5 commit 8c8534e
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
8 changes: 8 additions & 0 deletions objc/encoding.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
#ifndef __LIBOBJC_ENCODING_H_INCLUDED__
#define __LIBOBJC_ENCODING_H_INCLUDED__

#ifdef __cplusplus
extern "C" {
#endif

const char *objc_skip_type_qualifiers (const char *type);

const char *objc_skip_typespec(const char *type);
Expand Down Expand Up @@ -71,4 +75,8 @@ void objc_layout_structure_get_info (struct objc_struct_layout *layout,
#define _F_ONEWAY 0x10
#define _F_GCINVISIBLE 0x20

#ifdef __cplusplus
}
#endif

#endif // __LIBOBJC_ENCODING_H_INCLUDED__
8 changes: 7 additions & 1 deletion objc/hooks.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
#pragma clang system_header
#endif

#ifdef __cplusplus
extern "C" {
#endif

/**
* This file includes all of the hooks that can be used to alter the behaviour
* of the runtime.
Expand Down Expand Up @@ -106,4 +110,6 @@ typedef IMP (*objc_tracing_hook)(id, SEL, IMP, int, void*);
*/
int objc_registerTracingHook(SEL, objc_tracing_hook);


#ifdef __cplusplus
}
#endif
10 changes: 10 additions & 0 deletions objc/objc-arc.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@

#ifndef __OBJC_ARC_INCLUDED__
#define __OBJC_ARC_INCLUDED__

#ifdef __cplusplus
extern "C" {
#endif

/**
* Autoreleases the argument. Equivalent to [obj autorelease].
*/
Expand Down Expand Up @@ -106,5 +111,10 @@ unsigned long objc_arc_autorelease_count_np(void);
* this thread.
*/
unsigned long objc_arc_autorelease_count_for_object_np(id);

#ifdef __cplusplus
}
#endif

#endif // __OBJC_ARC_INCLUDED__

0 comments on commit 8c8534e

Please sign in to comment.