Index: src/OFApplication.h ================================================================== --- src/OFApplication.h +++ src/OFApplication.h @@ -163,6 +163,12 @@ @end @interface OFObject (OFApplicationDelegate) @end +#ifdef __cplusplus +extern "C" { +#endif extern int of_application_main(int*, char**[], Class); +#ifdef __cplusplus +} +#endif Index: src/OFBlock.h ================================================================== --- src/OFBlock.h +++ src/OFBlock.h @@ -57,12 +57,18 @@ OF_BLOCK_FIELD_IS_BYREF = 8, OF_BLOCK_FIELD_IS_WEAK = 16, OF_BLOCK_BYREF_CALLER = 128, }; +#ifdef __cplusplus +extern "C" { +#endif extern void* _Block_copy(const void*); extern void _Block_release(const void*); +#ifdef __cplusplus +} +#endif #ifndef Block_copy # define Block_copy(x) ((__typeof__(x))_Block_copy((const void*)(x))) #endif #ifndef Block_release Index: src/OFConstantString.h ================================================================== --- src/OFConstantString.h +++ src/OFConstantString.h @@ -15,13 +15,19 @@ */ #import "OFString.h" #ifdef OF_APPLE_RUNTIME +# ifdef __cplusplus +extern "C" { +#endif extern void *_OFConstantStringClassReference; +# ifdef __cplusplus +} +#endif #endif /** * \brief A class for storing constant strings using the \@"" literal. */ @interface OFConstantString: OFString @end Index: src/OFDictionary.h ================================================================== --- src/OFDictionary.h +++ src/OFDictionary.h @@ -213,6 +213,12 @@ @interface OFDictionaryKeyEnumerator: OFDictionaryEnumerator @end #import "OFMutableDictionary.h" +#ifdef __cplusplus +extern "C" { +#endif extern struct of_dictionary_bucket of_dictionary_deleted_bucket; +#ifdef __cplusplus +} +#endif Index: src/OFFile.h ================================================================== --- src/OFFile.h +++ src/OFFile.h @@ -19,11 +19,17 @@ #import "OFSeekableStream.h" @class OFArray; @class OFDate; +#ifdef __cplusplus +extern "C" { +#endif extern void of_log(OFConstantString*, ...); +#ifdef __cplusplus +} +#endif /** * \brief A class which provides functions to read, write and manipulate files. */ @interface OFFile: OFSeekableStream @@ -204,8 +210,14 @@ * It is not closed when the OFFile object is deallocated! */ - initWithFileDescriptor: (int)fd; @end +#ifdef __cplusplus +extern "C" { +#endif extern OFFile *of_stdin; extern OFFile *of_stdout; extern OFFile *of_stderr; +#ifdef __cplusplus +} +#endif Index: src/OFObject.h ================================================================== --- src/OFObject.h +++ src/OFObject.h @@ -406,6 +406,12 @@ * \return The result of the comparison */ - (of_comparison_result_t)compare: (id)obj; @end +#ifdef __cplusplus +extern "C" { +#endif extern size_t of_pagesize; +#ifdef __cplusplus +} +#endif Index: src/OFString+Hashing.h ================================================================== --- src/OFString+Hashing.h +++ src/OFString+Hashing.h @@ -14,11 +14,17 @@ * file. */ #import "OFString.h" +#ifdef __cplusplus +extern "C" { +#endif extern int _OFString_Hashing_reference; +#ifdef __cplusplus +} +#endif /** * The OFString (OFHashing) category provides methods to calculate hashes for * strings. */ Index: src/OFString+URLEncoding.h ================================================================== --- src/OFString+URLEncoding.h +++ src/OFString+URLEncoding.h @@ -14,11 +14,17 @@ * file. */ #import "OFString.h" +#ifdef __cplusplus +extern "C" { +#endif extern int _OFString_URLEncoding_reference; +#ifdef __cplusplus +} +#endif /** * \brief A category which provides URL encoding and decoding. */ @interface OFString (URLEncoding) Index: src/OFString+XMLEscaping.h ================================================================== --- src/OFString+XMLEscaping.h +++ src/OFString+XMLEscaping.h @@ -14,11 +14,17 @@ * file. */ #import "OFString.h" +#ifdef __cplusplus +extern "C" { +#endif extern int _OFString_XMLEscaping_reference; +#ifdef __cplusplus +} +#endif /** * \brief A category to escape strings for use in an XML document. */ @interface OFString (XMLEscaping) Index: src/OFString+XMLUnescaping.h ================================================================== --- src/OFString+XMLUnescaping.h +++ src/OFString+XMLUnescaping.h @@ -14,11 +14,17 @@ * file. */ #import "OFString.h" +#ifdef __cplusplus +extern "C" { +#endif extern int _OFString_XMLUnescaping_reference; +#ifdef __cplusplus +} +#endif #ifdef OF_HAVE_BLOCKS typedef OFString* (^of_string_xml_unescaping_block_t)(OFString *str, OFString *entity); #endif Index: src/OFString.h ================================================================== --- src/OFString.h +++ src/OFString.h @@ -29,15 +29,21 @@ OF_STRING_ENCODING_ISO_8859_1, OF_STRING_ENCODING_ISO_8859_15, OF_STRING_ENCODING_WINDOWS_1252 } of_string_encoding_t; +#ifdef __cplusplus +extern "C" { +#endif extern int of_string_check_utf8(const char*, size_t); extern size_t of_string_unicode_to_utf8(of_unichar_t, char*); extern size_t of_string_utf8_to_unicode(const char*, size_t, of_unichar_t*); extern size_t of_string_position_to_index(const char*, size_t); extern size_t of_string_index_to_position(const char*, size_t, size_t); +#ifdef __cplusplus +} +#endif @class OFArray; /** * \brief A class for handling strings. Index: src/asprintf.h ================================================================== --- src/asprintf.h +++ src/asprintf.h @@ -17,8 +17,14 @@ #import "objfw-defs.h" #ifndef OF_HAVE_ASPRINTF # include +# ifdef __cplusplus +extern "C" { +# endif extern int asprintf(char**, const char*, ...); extern int vasprintf(char**, const char*, va_list); +# ifdef __cplusplus +} +# endif #endif Index: src/of_asprintf.h ================================================================== --- src/of_asprintf.h +++ src/of_asprintf.h @@ -16,7 +16,13 @@ #include #import "macros.h" +#ifdef __cplusplus +extern "C" { +#endif extern int of_asprintf(char**, const char*, ...); extern int of_vasprintf(char**, const char*, va_list); +#ifdef __cplusplus +} +#endif Index: src/unicode.h ================================================================== --- src/unicode.h +++ src/unicode.h @@ -18,11 +18,17 @@ #define OF_UNICODE_UPPER_TABLE_SIZE 0x105 #define OF_UNICODE_LOWER_TABLE_SIZE 0x105 #define OF_UNICODE_CASEFOLDING_TABLE_SIZE 0x105 +#ifdef __cplusplus +extern "C" { +#endif extern const of_unichar_t* const of_unicode_upper_table[OF_UNICODE_UPPER_TABLE_SIZE]; extern const of_unichar_t* const of_unicode_lower_table[OF_UNICODE_LOWER_TABLE_SIZE]; extern const of_unichar_t* const of_unicode_casefolding_table[OF_UNICODE_CASEFOLDING_TABLE_SIZE]; +#ifdef __cplusplus +} +#endif