Remove EXTERN_C from WTF
authordbates@webkit.org <dbates@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 6 Sep 2016 17:17:11 +0000 (17:17 +0000)
committerdbates@webkit.org <dbates@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 6 Sep 2016 17:17:11 +0000 (17:17 +0000)
https://bugs.webkit.org/show_bug.cgi?id=161090

Reviewed by Brent Fulgham.

Guard external C declarations in WTF_EXTERN_C_BEGIN, WTF_EXTERN_C_END.

Source/WebCore:

* platform/spi/cf/CFLocaleSPI.h:
* platform/spi/cf/CFNetworkConnectionCacheSPI.h:
* platform/spi/cf/CFNetworkSPI.h: Additionally, remove the workaround for <rdar://problem/18337182>
as this bug was fixed in El Capitan.
* platform/spi/cf/CFUtilitiesSPI.h:
* platform/spi/cocoa/CoreTextSPI.h:
* platform/spi/cocoa/DataDetectorsCoreSPI.h:
* platform/spi/cocoa/IOPMLibSPI.h:
* platform/spi/cocoa/MachVMSPI.h:
* platform/spi/cocoa/QuartzCoreSPI.h:
* platform/spi/ios/MobileGestaltSPI.h:
* platform/spi/ios/QuickLookSPI.h:
* platform/spi/win/CoreTextSPIWin.cpp:
* platform/spi/win/CoreTextSPIWin.h:

Source/WebKit2:

* Platform/spi/ios/ManagedConfigurationSPI.h:

Source/WTF:

* wtf/Compiler.h: Remove macro definition EXTERN_C.
* wtf/spi/cf/CFBundleSPI.h:
* wtf/spi/cocoa/NSMapTableSPI.h:
* wtf/spi/cocoa/SecuritySPI.h:
* wtf/spi/darwin/CommonCryptoSPI.h:
* wtf/spi/darwin/SandboxSPI.h:
* wtf/spi/darwin/XPCSPI.h:
* wtf/spi/darwin/dyldSPI.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@205488 268f45cc-cd09-0410-ab3c-d52691b4dbfc

25 files changed:
Source/WTF/ChangeLog
Source/WTF/wtf/Compiler.h
Source/WTF/wtf/spi/cf/CFBundleSPI.h
Source/WTF/wtf/spi/cocoa/NSMapTableSPI.h
Source/WTF/wtf/spi/cocoa/SecuritySPI.h
Source/WTF/wtf/spi/darwin/CommonCryptoSPI.h
Source/WTF/wtf/spi/darwin/SandboxSPI.h
Source/WTF/wtf/spi/darwin/XPCSPI.h
Source/WTF/wtf/spi/darwin/dyldSPI.h
Source/WebCore/ChangeLog
Source/WebCore/platform/spi/cf/CFLocaleSPI.h
Source/WebCore/platform/spi/cf/CFNetworkConnectionCacheSPI.h
Source/WebCore/platform/spi/cf/CFNetworkSPI.h
Source/WebCore/platform/spi/cf/CFUtilitiesSPI.h
Source/WebCore/platform/spi/cocoa/CoreTextSPI.h
Source/WebCore/platform/spi/cocoa/DataDetectorsCoreSPI.h
Source/WebCore/platform/spi/cocoa/IOPMLibSPI.h
Source/WebCore/platform/spi/cocoa/MachVMSPI.h
Source/WebCore/platform/spi/cocoa/QuartzCoreSPI.h
Source/WebCore/platform/spi/ios/MobileGestaltSPI.h
Source/WebCore/platform/spi/ios/QuickLookSPI.h
Source/WebCore/platform/spi/win/CoreTextSPIWin.cpp
Source/WebCore/platform/spi/win/CoreTextSPIWin.h
Source/WebKit2/ChangeLog
Source/WebKit2/Platform/spi/ios/ManagedConfigurationSPI.h

index f2d944d..3af2cfd 100644 (file)
@@ -1,3 +1,21 @@
+2016-09-06  Daniel Bates  <dabates@apple.com>
+
+        Remove EXTERN_C from WTF
+        https://bugs.webkit.org/show_bug.cgi?id=161090
+
+        Reviewed by Brent Fulgham.
+
+        Guard external C declarations in WTF_EXTERN_C_BEGIN, WTF_EXTERN_C_END.
+
+        * wtf/Compiler.h: Remove macro definition EXTERN_C.
+        * wtf/spi/cf/CFBundleSPI.h:
+        * wtf/spi/cocoa/NSMapTableSPI.h:
+        * wtf/spi/cocoa/SecuritySPI.h:
+        * wtf/spi/darwin/CommonCryptoSPI.h:
+        * wtf/spi/darwin/SandboxSPI.h:
+        * wtf/spi/darwin/XPCSPI.h:
+        * wtf/spi/darwin/dyldSPI.h:
+
 2016-08-31  Filip Pizlo  <fpizlo@apple.com>
 
         Butterflies should be allocated in Auxiliary MarkedSpace instead of CopiedSpace and we should rewrite as much of the GC as needed to make this not a regression
index b95bf1c..288eb4a 100644 (file)
 #define WTF_EXTERN_C_END
 #endif
 
-/* FIXME: Remove this once we have transitioned to WTF_EXTERN_C_BEGIN/WTF_EXTERN_C_END. */
-#ifdef __cplusplus
-#define EXTERN_C extern "C"
-#else
-#define EXTERN_C extern
-#endif
-
 /* FALLTHROUGH */
 
 #if !defined(FALLTHROUGH) && COMPILER_SUPPORTS(FALLTHROUGH_WARNINGS) && COMPILER(CLANG)
index 4ef0ae3..aae91ec 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2015 Apple Inc.  All rights reserved.
+ * Copyright (C) 2015-2016 Apple Inc.  All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
 #include <wtf/spi/darwin/XPCSPI.h>
 #endif
 
-extern "C" {
+WTF_EXTERN_C_BEGIN
+
 void _CFBundleSetupXPCBootstrap(xpc_object_t bootstrap);
 
 Boolean CFBundleGetLocalizationInfoForLocalization(CFStringRef localizationName, SInt32 *languageCode, SInt32 *regionCode, SInt32 *scriptCode, CFStringEncoding *stringEncoding);
 CFStringRef CFBundleCopyLocalizationForLocalizationInfo(SInt32 languageCode, SInt32 regionCode, SInt32 scriptCode, CFStringEncoding stringEncoding);
-}
+
+WTF_EXTERN_C_END
 
 #endif
index ebb0014..e7c1a14 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2014-2016 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
 #import <Foundation/NSMapTablePriv.h>
 #endif
 
-EXTERN_C void *NSMapGet(NSMapTable *, const void *key);
-EXTERN_C void NSMapInsert(NSMapTable *, const void *key, const void *value);
-EXTERN_C void NSMapRemove(NSMapTable *, const void *key);
+WTF_EXTERN_C_BEGIN
+
+void *NSMapGet(NSMapTable *, const void *key);
+void NSMapInsert(NSMapTable *, const void *key, const void *value);
+void NSMapRemove(NSMapTable *, const void *key);
+
+WTF_EXTERN_C_END
index 2edfc3f..ca5bf12 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2015 Apple Inc. All rights reserved.
+ * Copyright (C) 2015-2016 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -51,18 +51,25 @@ enum {
     kSecSignatureHashAlgorithmSHA512 = 8
 };
 
-EXTERN_C SecSignatureHashAlgorithm SecCertificateGetSignatureHashAlgorithm(SecCertificateRef);
+WTF_EXTERN_C_BEGIN
+
+SecSignatureHashAlgorithm SecCertificateGetSignatureHashAlgorithm(SecCertificateRef);
+
+WTF_EXTERN_C_END
 #endif
 
 #endif
 
 typedef struct __SecTask *SecTaskRef;
-EXTERN_C SecTaskRef SecTaskCreateWithAuditToken(CFAllocatorRef, audit_token_t);
-EXTERN_C SecTaskRef SecTaskCreateFromSelf(CFAllocatorRef);
-EXTERN_C CFTypeRef SecTaskCopyValueForEntitlement(SecTaskRef, CFStringRef entitlement, CFErrorRef *);
+
+WTF_EXTERN_C_BEGIN
+
+SecTaskRef SecTaskCreateWithAuditToken(CFAllocatorRef, audit_token_t);
+SecTaskRef SecTaskCreateFromSelf(CFAllocatorRef);
+CFTypeRef SecTaskCopyValueForEntitlement(SecTaskRef, CFStringRef entitlement, CFErrorRef *);
 
 #if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101200
-EXTERN_C CFStringRef SecTaskCopySigningIdentifier(SecTaskRef, CFErrorRef *);
+CFStringRef SecTaskCopySigningIdentifier(SecTaskRef, CFErrorRef *);
 #endif
 
 #if PLATFORM(MAC)
@@ -72,6 +79,8 @@ extern const SecAsn1Template kSecAsn1SubjectPublicKeyInfoTemplate[];
 #endif
 
 #if HAVE(SEC_TRUST_SERIALIZATION)
-EXTERN_C CF_RETURNS_RETAINED CFDataRef SecTrustSerialize(SecTrustRef, CFErrorRef *);
-EXTERN_C CF_RETURNS_RETAINED SecTrustRef SecTrustDeserialize(CFDataRef serializedTrust, CFErrorRef *);
+CF_RETURNS_RETAINED CFDataRef SecTrustSerialize(SecTrustRef, CFErrorRef *);
+CF_RETURNS_RETAINED SecTrustRef SecTrustDeserialize(CFDataRef serializedTrust, CFErrorRef *);
 #endif
+
+WTF_EXTERN_C_END
index 325cbe8..f79bff9 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2015 Apple Inc. All rights reserved.
+ * Copyright (C) 2015-2016 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
 #endif
 
 typedef struct __CCRandom* CCRandomRef;
+
+WTF_EXTERN_C_BEGIN
+
 extern const CCRandomRef kCCRandomDefault;
-extern "C" int CCRandomCopyBytes(CCRandomRef rnd, void *bytes, size_t count);
+int CCRandomCopyBytes(CCRandomRef rnd, void *bytes, size_t count);
+
+WTF_EXTERN_C_END
 
 #endif // OS(DARWIN)
 
index 943849d..50e6814 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2015 Apple Inc. All rights reserved.
+ * Copyright (C) 2015-2016 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -41,10 +41,14 @@ enum sandbox_filter_type {
 #define SANDBOX_NAMED_EXTERNAL 0x0003
 #endif
 
-EXTERN_C const enum sandbox_filter_type SANDBOX_CHECK_NO_REPORT;
-EXTERN_C int sandbox_check(pid_t, const char *operation, enum sandbox_filter_type, ...);
-EXTERN_C int sandbox_container_path_for_pid(pid_t, char *buffer, size_t bufsize);
-EXTERN_C int sandbox_init_with_parameters(const char *profile, uint64_t flags, const char *const parameters[], char **errorbuf);
+WTF_EXTERN_C_BEGIN
+
+extern const enum sandbox_filter_type SANDBOX_CHECK_NO_REPORT;
+int sandbox_check(pid_t, const char *operation, enum sandbox_filter_type, ...);
+int sandbox_container_path_for_pid(pid_t, char *buffer, size_t bufsize);
+int sandbox_init_with_parameters(const char *profile, uint64_t flags, const char *const parameters[], char **errorbuf);
+
+WTF_EXTERN_C_END
 
 #endif // OS(DARWIN)
 
index a11b2ee..ed6e69d 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2014-2016 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -79,71 +79,73 @@ typedef void (*xpc_connection_handler_t)(xpc_connection_t connection);
 #include <xpc/private.h>
 #endif
 
-EXTERN_C const struct _xpc_dictionary_s _xpc_error_connection_invalid;
-EXTERN_C const struct _xpc_dictionary_s _xpc_error_termination_imminent;
+WTF_EXTERN_C_BEGIN
 
-EXTERN_C const struct _xpc_type_s _xpc_type_array;
-EXTERN_C const struct _xpc_type_s _xpc_type_bool;
-EXTERN_C const struct _xpc_type_s _xpc_type_dictionary;
-EXTERN_C const struct _xpc_type_s _xpc_type_error;
-EXTERN_C const struct _xpc_type_s _xpc_type_string;
+extern const struct _xpc_dictionary_s _xpc_error_connection_invalid;
+extern const struct _xpc_dictionary_s _xpc_error_termination_imminent;
 
-EXTERN_C xpc_object_t xpc_array_create(const xpc_object_t*, size_t count);
+extern const struct _xpc_type_s _xpc_type_array;
+extern const struct _xpc_type_s _xpc_type_bool;
+extern const struct _xpc_type_s _xpc_type_dictionary;
+extern const struct _xpc_type_s _xpc_type_error;
+extern const struct _xpc_type_s _xpc_type_string;
+
+xpc_object_t xpc_array_create(const xpc_object_t*, size_t count);
 #if COMPILER_SUPPORTS(BLOCKS)
-EXTERN_C bool xpc_array_apply(xpc_object_t, xpc_array_applier_t);
-EXTERN_C bool xpc_dictionary_apply(xpc_object_t xdict, xpc_dictionary_applier_t applier);
+bool xpc_array_apply(xpc_object_t, xpc_array_applier_t);
+bool xpc_dictionary_apply(xpc_object_t xdict, xpc_dictionary_applier_t applier);
 #endif
-EXTERN_C size_t xpc_array_get_count(xpc_object_t);
-EXTERN_C const char* xpc_array_get_string(xpc_object_t, size_t index);
-EXTERN_C void xpc_array_set_string(xpc_object_t, size_t index, const char* string);
-EXTERN_C bool xpc_bool_get_value(xpc_object_t);
-EXTERN_C void xpc_connection_cancel(xpc_connection_t);
-EXTERN_C xpc_connection_t xpc_connection_create(const char* name, dispatch_queue_t);
-EXTERN_C xpc_connection_t xpc_connection_create_mach_service(const char* name, dispatch_queue_t, uint64_t flags);
-EXTERN_C pid_t xpc_connection_get_pid(xpc_connection_t);
-EXTERN_C void xpc_connection_resume(xpc_connection_t);
-EXTERN_C void xpc_connection_send_message(xpc_connection_t, xpc_object_t);
-EXTERN_C void xpc_connection_send_message_with_reply(xpc_connection_t, xpc_object_t, dispatch_queue_t, xpc_handler_t);
-EXTERN_C void xpc_connection_set_event_handler(xpc_connection_t, xpc_handler_t);
-EXTERN_C void xpc_connection_set_target_queue(xpc_connection_t, dispatch_queue_t);
-EXTERN_C xpc_object_t xpc_dictionary_create(const char*  const* keys, const xpc_object_t*, size_t count);
-EXTERN_C xpc_object_t xpc_dictionary_create_reply(xpc_object_t);
-EXTERN_C int xpc_dictionary_dup_fd(xpc_object_t, const char* key);
-EXTERN_C xpc_connection_t xpc_dictionary_get_remote_connection(xpc_object_t);
-EXTERN_C bool xpc_dictionary_get_bool(xpc_object_t, const char* key);
-EXTERN_C const char* xpc_dictionary_get_string(xpc_object_t, const char* key);
-EXTERN_C uint64_t xpc_dictionary_get_uint64(xpc_object_t, const char* key);
-EXTERN_C xpc_object_t xpc_dictionary_get_value(xpc_object_t, const char* key);
-EXTERN_C void xpc_dictionary_set_bool(xpc_object_t, const char* key, bool value);
-EXTERN_C void xpc_dictionary_set_fd(xpc_object_t, const char* key, int fd);
-EXTERN_C void xpc_dictionary_set_string(xpc_object_t, const char* key, const char* string);
-EXTERN_C void xpc_dictionary_set_uint64(xpc_object_t, const char* key, uint64_t value);
-EXTERN_C void xpc_dictionary_set_value(xpc_object_t, const char*key, xpc_object_t value);
-EXTERN_C xpc_type_t xpc_get_type(xpc_object_t);
-EXTERN_C void xpc_main(xpc_connection_handler_t);
-EXTERN_C const char* xpc_string_get_string_ptr(xpc_object_t);
-EXTERN_C void xpc_transaction_begin(void);
-EXTERN_C void xpc_transaction_end(void);
-EXTERN_C void xpc_transaction_exit_clean(void);
-EXTERN_C void xpc_track_activity(void);
-
-EXTERN_C xpc_object_t xpc_connection_copy_entitlement_value(xpc_connection_t, const char* entitlement);
-EXTERN_C void xpc_connection_get_audit_token(xpc_connection_t, audit_token_t*);
-EXTERN_C void xpc_connection_kill(xpc_connection_t, int);
-EXTERN_C void xpc_connection_set_instance(xpc_connection_t, uuid_t);
-EXTERN_C mach_port_t xpc_dictionary_copy_mach_send(xpc_object_t, const char*);
-EXTERN_C void xpc_dictionary_set_mach_send(xpc_object_t, const char*, mach_port_t);
-
-EXTERN_C void xpc_connection_set_bootstrap(xpc_connection_t, xpc_object_t bootstrap);
-EXTERN_C xpc_object_t xpc_copy_bootstrap(void);
-EXTERN_C void xpc_connection_set_oneshot_instance(xpc_connection_t, uuid_t instance);
+size_t xpc_array_get_count(xpc_object_t);
+const char* xpc_array_get_string(xpc_object_t, size_t index);
+void xpc_array_set_string(xpc_object_t, size_t index, const char* string);
+bool xpc_bool_get_value(xpc_object_t);
+void xpc_connection_cancel(xpc_connection_t);
+xpc_connection_t xpc_connection_create(const char* name, dispatch_queue_t);
+xpc_connection_t xpc_connection_create_mach_service(const char* name, dispatch_queue_t, uint64_t flags);
+pid_t xpc_connection_get_pid(xpc_connection_t);
+void xpc_connection_resume(xpc_connection_t);
+void xpc_connection_send_message(xpc_connection_t, xpc_object_t);
+void xpc_connection_send_message_with_reply(xpc_connection_t, xpc_object_t, dispatch_queue_t, xpc_handler_t);
+void xpc_connection_set_event_handler(xpc_connection_t, xpc_handler_t);
+void xpc_connection_set_target_queue(xpc_connection_t, dispatch_queue_t);
+xpc_object_t xpc_dictionary_create(const char*  const* keys, const xpc_object_t*, size_t count);
+xpc_object_t xpc_dictionary_create_reply(xpc_object_t);
+int xpc_dictionary_dup_fd(xpc_object_t, const char* key);
+xpc_connection_t xpc_dictionary_get_remote_connection(xpc_object_t);
+bool xpc_dictionary_get_bool(xpc_object_t, const char* key);
+const char* xpc_dictionary_get_string(xpc_object_t, const char* key);
+uint64_t xpc_dictionary_get_uint64(xpc_object_t, const char* key);
+xpc_object_t xpc_dictionary_get_value(xpc_object_t, const char* key);
+void xpc_dictionary_set_bool(xpc_object_t, const char* key, bool value);
+void xpc_dictionary_set_fd(xpc_object_t, const char* key, int fd);
+void xpc_dictionary_set_string(xpc_object_t, const char* key, const char* string);
+void xpc_dictionary_set_uint64(xpc_object_t, const char* key, uint64_t value);
+void xpc_dictionary_set_value(xpc_object_t, const char*key, xpc_object_t value);
+xpc_type_t xpc_get_type(xpc_object_t);
+void xpc_main(xpc_connection_handler_t);
+const char* xpc_string_get_string_ptr(xpc_object_t);
+void xpc_transaction_begin(void);
+void xpc_transaction_end(void);
+void xpc_transaction_exit_clean(void);
+void xpc_track_activity(void);
+
+xpc_object_t xpc_connection_copy_entitlement_value(xpc_connection_t, const char* entitlement);
+void xpc_connection_get_audit_token(xpc_connection_t, audit_token_t*);
+void xpc_connection_kill(xpc_connection_t, int);
+void xpc_connection_set_instance(xpc_connection_t, uuid_t);
+mach_port_t xpc_dictionary_copy_mach_send(xpc_object_t, const char*);
+void xpc_dictionary_set_mach_send(xpc_object_t, const char*, mach_port_t);
+
+void xpc_connection_set_bootstrap(xpc_connection_t, xpc_object_t bootstrap);
+xpc_object_t xpc_copy_bootstrap(void);
+void xpc_connection_set_oneshot_instance(xpc_connection_t, uuid_t instance);
 
 #if OS_OBJECT_USE_OBJC_RETAIN_RELEASE
 #if !defined(xpc_retain)
 #define xpc_retain(object) ({ xpc_object_t _o = (object); _xpc_object_validate(_o); [_o retain]; })
 #endif
 #else
-EXTERN_C xpc_object_t xpc_retain(xpc_object_t);
+xpc_object_t xpc_retain(xpc_object_t);
 #endif
 
 #if OS_OBJECT_USE_OBJC_RETAIN_RELEASE
@@ -151,7 +153,9 @@ EXTERN_C xpc_object_t xpc_retain(xpc_object_t);
 #define xpc_release(object) ({ xpc_object_t _o = (object); _xpc_object_validate(_o); [_o release]; })
 #endif
 #else
-EXTERN_C void xpc_release(xpc_object_t);
+void xpc_release(xpc_object_t);
 #endif
 
+WTF_EXTERN_C_END
+
 #endif // XPCSPI_h
index 884b934..658db12 100644 (file)
@@ -51,4 +51,8 @@
 
 #endif
 
-extern "C" uint32_t dyld_get_program_sdk_version();
+WTF_EXTERN_C_BEGIN
+
+uint32_t dyld_get_program_sdk_version();
+
+WTF_EXTERN_C_END
index 8232701..7e943cf 100644 (file)
@@ -1,3 +1,27 @@
+2016-09-06  Daniel Bates  <dabates@apple.com>
+
+        Remove EXTERN_C from WTF
+        https://bugs.webkit.org/show_bug.cgi?id=161090
+
+        Reviewed by Brent Fulgham.
+
+        Guard external C declarations in WTF_EXTERN_C_BEGIN, WTF_EXTERN_C_END.
+
+        * platform/spi/cf/CFLocaleSPI.h:
+        * platform/spi/cf/CFNetworkConnectionCacheSPI.h:
+        * platform/spi/cf/CFNetworkSPI.h: Additionally, remove the workaround for <rdar://problem/18337182>
+        as this bug was fixed in El Capitan.
+        * platform/spi/cf/CFUtilitiesSPI.h:
+        * platform/spi/cocoa/CoreTextSPI.h:
+        * platform/spi/cocoa/DataDetectorsCoreSPI.h:
+        * platform/spi/cocoa/IOPMLibSPI.h:
+        * platform/spi/cocoa/MachVMSPI.h:
+        * platform/spi/cocoa/QuartzCoreSPI.h:
+        * platform/spi/ios/MobileGestaltSPI.h:
+        * platform/spi/ios/QuickLookSPI.h:
+        * platform/spi/win/CoreTextSPIWin.cpp:
+        * platform/spi/win/CoreTextSPIWin.h:
+
 2016-09-06  Ryan Haddad  <ryanhaddad@apple.com>
 
         Unreviewed, rolling out r205407.
index 3d1a185..1cf435e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2014 Apple Inc.  All rights reserved.
+ * Copyright (C) 2014-2016 Apple Inc.  All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
 #import <CoreFoundation/CFPriv.h>
 #endif
 
-extern "C" {
+WTF_EXTERN_C_BEGIN
+
 // FIXME: <rdar://problem/18128192> Make CFLocaleGetLanguageRegionEncodingForLocaleIdentifier public API
 // FIXME: <rdar://problem/18083880> Replace use of Script Manager to canonicalize locales with a custom Web-specific table
 Boolean CFLocaleGetLanguageRegionEncodingForLocaleIdentifier(CFStringRef locale, LangCode*, RegionCode*, ScriptCode*, CFStringEncoding*);
-}
+
+WTF_EXTERN_C_END
 
 #endif
index e7104e3..aa09d9e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2014-2015 Apple Inc. All rights reserved.
+ * Copyright (C) 2014-2016 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -37,7 +37,11 @@ enum HTTPConnectionCacheLimitKeys {
 };
 #endif
 
-EXTERN_C int _CFNetworkHTTPConnectionCacheGetLimit(HTTPConnectionCacheLimitKeys);
-EXTERN_C void _CFNetworkHTTPConnectionCacheSetLimit(HTTPConnectionCacheLimitKeys, int);
+WTF_EXTERN_C_BEGIN
+
+int _CFNetworkHTTPConnectionCacheGetLimit(HTTPConnectionCacheLimitKeys);
+void _CFNetworkHTTPConnectionCacheSetLimit(HTTPConnectionCacheLimitKeys, int);
+
+WTF_EXTERN_C_END
 
 #endif // CFNetworkConnectionCacheSPI_h
index 5d8836e..608774b 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2014-2016 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
 
 // FIXME: Remove the defined(__OBJC__)-guard once we fix <rdar://problem/19033610>.
 #if defined(__OBJC__) && PLATFORM(COCOA)
-// FIXME: As a workaround for <rdar://problem/18337182>, we conditionally enclose the header
-// in an extern "C" linkage block to make it suitable for C++ use.
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 #import <CFNetwork/CFNSURLConnection.h>
-
-#ifdef __cplusplus
-}
-#endif
 #endif // defined(__OBJC__) && PLATFORM(COCOA)
 
 #else // !PLATFORM(WIN) && !USE(APPLE_INTERNAL_SDK)
@@ -133,53 +123,57 @@ typedef void (^CFCachedURLResponseCallBackBlock)(CFCachedURLResponseRef);
 
 #endif // !PLATFORM(WIN) && !USE(APPLE_INTERNAL_SDK)
 
+WTF_EXTERN_C_BEGIN
+
 #if !PLATFORM(WIN)
-EXTERN_C void CFURLRequestSetShouldStartSynchronously(CFURLRequestRef, Boolean);
+void CFURLRequestSetShouldStartSynchronously(CFURLRequestRef, Boolean);
 
-EXTERN_C CFURLCacheRef CFURLCacheCopySharedURLCache();
-EXTERN_C void CFURLCacheSetMemoryCapacity(CFURLCacheRef, CFIndex memoryCapacity);
+CFURLCacheRef CFURLCacheCopySharedURLCache();
+void CFURLCacheSetMemoryCapacity(CFURLCacheRef, CFIndex memoryCapacity);
 #if PLATFORM(COCOA)
-EXTERN_C Boolean _CFNetworkIsKnownHSTSHostWithSession(CFURLRef, CFURLStorageSessionRef);
-EXTERN_C void _CFNetworkResetHSTSHostsWithSession(CFURLStorageSessionRef);
+Boolean _CFNetworkIsKnownHSTSHostWithSession(CFURLRef, CFURLStorageSessionRef);
+void _CFNetworkResetHSTSHostsWithSession(CFURLStorageSessionRef);
 #endif
 
-EXTERN_C void CFHTTPCookieStorageDeleteAllCookies(CFHTTPCookieStorageRef);
+void CFHTTPCookieStorageDeleteAllCookies(CFHTTPCookieStorageRef);
 
 #if PLATFORM(COCOA)
-EXTERN_C CFDataRef _CFCachedURLResponseGetMemMappedData(CFCachedURLResponseRef);
+CFDataRef _CFCachedURLResponseGetMemMappedData(CFCachedURLResponseRef);
 #ifdef __BLOCKS__
-EXTERN_C void _CFCachedURLResponseSetBecameFileBackedCallBackBlock(CFCachedURLResponseRef, CFCachedURLResponseCallBackBlock, dispatch_queue_t);
+void _CFCachedURLResponseSetBecameFileBackedCallBackBlock(CFCachedURLResponseRef, CFCachedURLResponseCallBackBlock, dispatch_queue_t);
 #endif
 #endif // PLATFORM(COCOA)
 
-EXTERN_C void CFURLConnectionInvalidateConnectionCache();
-
-EXTERN_C CFStringRef const kCFHTTPCookieLocalFileDomain;
-EXTERN_C const CFStringRef kCFURLRequestAllowAllPOSTCaching;
-
-EXTERN_C const CFStringRef _kCFURLConnectionPropertyShouldSniff;
-
-EXTERN_C CFHTTPCookieStorageRef _CFHTTPCookieStorageGetDefault(CFAllocatorRef);
-EXTERN_C void CFHTTPCookieStorageSetCookie(CFHTTPCookieStorageRef, CFHTTPCookieRef);
-EXTERN_C void CFHTTPCookieStorageSetCookieAcceptPolicy(CFHTTPCookieStorageRef, CFHTTPCookieStorageAcceptPolicy);
-EXTERN_C void _CFNetworkSetOverrideSystemProxySettings(CFDictionaryRef);
-EXTERN_C CFURLCredentialStorageRef CFURLCredentialStorageCreate(CFAllocatorRef);
-EXTERN_C CFURLCredentialRef CFURLCredentialStorageCopyDefaultCredentialForProtectionSpace(CFURLCredentialStorageRef, CFURLProtectionSpaceRef);
-EXTERN_C CFURLRequestPriority CFURLRequestGetRequestPriority(CFURLRequestRef);
-EXTERN_C void _CFURLRequestSetProtocolProperty(CFURLRequestRef, CFStringRef, CFTypeRef);
-EXTERN_C void CFURLRequestSetRequestPriority(CFURLRequestRef, CFURLRequestPriority);
-EXTERN_C void CFURLRequestSetShouldPipelineHTTP(CFURLRequestRef, Boolean, Boolean);
-EXTERN_C void _CFURLRequestSetStorageSession(CFMutableURLRequestRef, CFURLStorageSessionRef);
-EXTERN_C CFStringRef CFURLResponseCopySuggestedFilename(CFURLResponseRef);
-EXTERN_C CFHTTPMessageRef CFURLResponseGetHTTPResponse(CFURLResponseRef);
-EXTERN_C CFStringRef CFURLResponseGetMIMEType(CFURLResponseRef);
-EXTERN_C CFDictionaryRef _CFURLResponseGetSSLCertificateContext(CFURLResponseRef);
-EXTERN_C CFURLRef CFURLResponseGetURL(CFURLResponseRef);
-EXTERN_C void CFURLResponseSetMIMEType(CFURLResponseRef, CFStringRef);
-EXTERN_C CFHTTPCookieStorageRef _CFURLStorageSessionCopyCookieStorage(CFAllocatorRef, CFURLStorageSessionRef);
-EXTERN_C CFArrayRef _CFHTTPCookieStorageCopyCookiesForURLWithMainDocumentURL(CFHTTPCookieStorageRef inCookieStorage, CFURLRef inURL, CFURLRef inMainDocumentURL, Boolean sendSecureCookies);
+void CFURLConnectionInvalidateConnectionCache();
+
+extern CFStringRef const kCFHTTPCookieLocalFileDomain;
+extern const CFStringRef kCFURLRequestAllowAllPOSTCaching;
+
+extern const CFStringRef _kCFURLConnectionPropertyShouldSniff;
+
+CFHTTPCookieStorageRef _CFHTTPCookieStorageGetDefault(CFAllocatorRef);
+void CFHTTPCookieStorageSetCookie(CFHTTPCookieStorageRef, CFHTTPCookieRef);
+void CFHTTPCookieStorageSetCookieAcceptPolicy(CFHTTPCookieStorageRef, CFHTTPCookieStorageAcceptPolicy);
+void _CFNetworkSetOverrideSystemProxySettings(CFDictionaryRef);
+CFURLCredentialStorageRef CFURLCredentialStorageCreate(CFAllocatorRef);
+CFURLCredentialRef CFURLCredentialStorageCopyDefaultCredentialForProtectionSpace(CFURLCredentialStorageRef, CFURLProtectionSpaceRef);
+CFURLRequestPriority CFURLRequestGetRequestPriority(CFURLRequestRef);
+void _CFURLRequestSetProtocolProperty(CFURLRequestRef, CFStringRef, CFTypeRef);
+void CFURLRequestSetRequestPriority(CFURLRequestRef, CFURLRequestPriority);
+void CFURLRequestSetShouldPipelineHTTP(CFURLRequestRef, Boolean, Boolean);
+void _CFURLRequestSetStorageSession(CFMutableURLRequestRef, CFURLStorageSessionRef);
+CFStringRef CFURLResponseCopySuggestedFilename(CFURLResponseRef);
+CFHTTPMessageRef CFURLResponseGetHTTPResponse(CFURLResponseRef);
+CFStringRef CFURLResponseGetMIMEType(CFURLResponseRef);
+CFDictionaryRef _CFURLResponseGetSSLCertificateContext(CFURLResponseRef);
+CFURLRef CFURLResponseGetURL(CFURLResponseRef);
+void CFURLResponseSetMIMEType(CFURLResponseRef, CFStringRef);
+CFHTTPCookieStorageRef _CFURLStorageSessionCopyCookieStorage(CFAllocatorRef, CFURLStorageSessionRef);
+CFArrayRef _CFHTTPCookieStorageCopyCookiesForURLWithMainDocumentURL(CFHTTPCookieStorageRef inCookieStorage, CFURLRef inURL, CFURLRef inMainDocumentURL, Boolean sendSecureCookies);
 #endif // !PLATFORM(WIN)
 
+WTF_EXTERN_C_END
+
 // FIXME: We should only forward declare this SPI when building for iOS without the Apple Internal SDK.
 // As a workaround for <rdar://problem/19025016>, we must forward declare this SPI regardless of whether
 // we are building with the Apple Internal SDK.
@@ -200,21 +194,25 @@ enum : NSUInteger {
 @end
 #endif
 
+WTF_EXTERN_C_BEGIN
+
 #if TARGET_OS_IPHONE || (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101100)
-EXTERN_C CFDataRef _CFNetworkCopyATSContext(void);
-EXTERN_C Boolean _CFNetworkSetATSContext(CFDataRef);
+CFDataRef _CFNetworkCopyATSContext(void);
+Boolean _CFNetworkSetATSContext(CFDataRef);
 #endif
 
 #if PLATFORM(COCOA)
-EXTERN_C void _CFNetworkResetHSTSHostsSinceDate(CFURLStorageSessionRef, CFDateRef);
+void _CFNetworkResetHSTSHostsSinceDate(CFURLStorageSessionRef, CFDateRef);
 #endif
 
 #if TARGET_OS_IPHONE || (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101100)
-EXTERN_C CFDataRef CFHTTPCookieStorageCreateIdentifyingData(CFAllocatorRef inAllocator, CFHTTPCookieStorageRef inStorage);
-EXTERN_C CFHTTPCookieStorageRef CFHTTPCookieStorageCreateFromIdentifyingData(CFAllocatorRef inAllocator, CFDataRef inData);
-EXTERN_C CFArrayRef _CFHTTPParsedCookiesWithResponseHeaderFields(CFAllocatorRef inAllocator, CFDictionaryRef headerFields, CFURLRef inURL);
+CFDataRef CFHTTPCookieStorageCreateIdentifyingData(CFAllocatorRef inAllocator, CFHTTPCookieStorageRef inStorage);
+CFHTTPCookieStorageRef CFHTTPCookieStorageCreateFromIdentifyingData(CFAllocatorRef inAllocator, CFDataRef inData);
+CFArrayRef _CFHTTPParsedCookiesWithResponseHeaderFields(CFAllocatorRef inAllocator, CFDictionaryRef headerFields, CFURLRef inURL);
 #endif
 
+WTF_EXTERN_C_END
+
 #if defined(__OBJC__)
 
 @interface NSHTTPCookie ()
index 15686b4..fc8cd79 100644 (file)
 #import <CoreFoundation/CFPriv.h>
 #endif
 
-extern "C" {
+WTF_EXTERN_C_BEGIN
+
 CFDictionaryRef _CFCopySystemVersionDictionary(void);
 extern const CFStringRef _kCFSystemVersionProductVersionKey;
 extern const CFStringRef _kCFSystemVersionBuildVersionKey;
-}
+
+WTF_EXTERN_C_END
+
index 025b912..951a7e0 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2014 Apple Inc.  All rights reserved.
+ * Copyright (C) 2014-2016 Apple Inc.  All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -56,7 +56,7 @@ typedef CF_OPTIONS(uint32_t, CTFontDescriptorOptions)
 
 #endif
 
-extern "C" {
+WTF_EXTERN_C_BEGIN
 
 typedef const UniChar* (*CTUniCharProviderCallback)(CFIndex stringIndex, CFIndex* charCount, CFDictionaryRef* attributes, void* refCon);
 typedef void (*CTUniCharDisposeCallback)(const UniChar* chars, void* refCon);
@@ -122,6 +122,6 @@ bool CTFontIsAppleColorEmoji(CTFontRef);
 bool CTFontDescriptorIsSystemUIFont(CTFontDescriptorRef);
 CTFontRef CTFontCreateForCharacters(CTFontRef currentFont, const UTF16Char *characters, CFIndex length, CFIndex *coveredLength);
 
-}
+WTF_EXTERN_C_END
 
 #endif
index 54a4cbb..a0c3697 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2014-2015 Apple Inc. All rights reserved.
+ * Copyright (C) 2014-2016 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -127,7 +127,7 @@ enum {
     DDScannerSourceSpotlight = 1<<1,
 };
 
-extern "C" {
+WTF_EXTERN_C_BEGIN
 
 extern const DDScannerCopyResultsOptions DDScannerCopyResultsOptionsForPassiveUse;
 
@@ -148,6 +148,6 @@ bool DDResultHasProperties(DDResultRef, CFIndex propertySet);
 CFArrayRef DDResultGetSubResults(DDResultRef);
 DDQueryRange DDResultGetQueryRangeForURLification(DDResultRef);
 
-}
+WTF_EXTERN_C_END
 
 #endif // DataDetectorsCoreSPI_h
index 03b9c54..e1ce3ad 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2014-2016 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
 
 typedef uint32_t IOPMAssertionID;
 
-EXTERN_C const CFStringRef kIOPMAssertionTypePreventUserIdleDisplaySleep = CFSTR("PreventUserIdleDisplaySleep");
+WTF_EXTERN_C_BEGIN
+
+const CFStringRef kIOPMAssertionTypePreventUserIdleDisplaySleep = CFSTR("PreventUserIdleDisplaySleep");
+
+WTF_EXTERN_C_END
 
 #endif
 
-EXTERN_C IOReturn IOPMAssertionCreateWithDescription(CFStringRef assertionType, CFStringRef name, CFStringRef details, CFStringRef humanReadableReason,
+WTF_EXTERN_C_BEGIN
+
+IOReturn IOPMAssertionCreateWithDescription(CFStringRef assertionType, CFStringRef name, CFStringRef details, CFStringRef humanReadableReason,
                                                      CFStringRef localizationBundlePath, CFTimeInterval timeout, CFStringRef timeoutAction, IOPMAssertionID *);
-EXTERN_C IOReturn IOPMAssertionRelease(IOPMAssertionID);
+IOReturn IOPMAssertionRelease(IOPMAssertionID);
+
+WTF_EXTERN_C_END
 
 #endif // IOPMLibSPI_h
index d8f618d..5a1faa2 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2014-2016 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
 #include <mach/mach_vm.h>
 #endif
 
-EXTERN_C kern_return_t mach_vm_allocate(vm_map_t target, mach_vm_address_t*, mach_vm_size_t, int flags);
-EXTERN_C kern_return_t mach_vm_deallocate(vm_map_t target, mach_vm_address_t, mach_vm_size_t);
-EXTERN_C kern_return_t mach_vm_map(vm_map_t targetTask, mach_vm_address_t*, mach_vm_size_t, mach_vm_offset_t mask, int flags,
+WTF_EXTERN_C_BEGIN
+
+kern_return_t mach_vm_allocate(vm_map_t target, mach_vm_address_t*, mach_vm_size_t, int flags);
+kern_return_t mach_vm_deallocate(vm_map_t target, mach_vm_address_t, mach_vm_size_t);
+kern_return_t mach_vm_map(vm_map_t targetTask, mach_vm_address_t*, mach_vm_size_t, mach_vm_offset_t mask, int flags,
                                    mem_entry_name_port_t, memory_object_offset_t, boolean_t copy, vm_prot_t currentProtection, vm_prot_t maximumProtection, vm_inherit_t);
-EXTERN_C kern_return_t mach_vm_protect(vm_map_t targetTask, mach_vm_address_t, mach_vm_size_t, boolean_t setMaximum, vm_prot_t newProtection);
-EXTERN_C kern_return_t mach_vm_region(vm_map_t targetTask, mach_vm_address_t*, mach_vm_size_t*, vm_region_flavor_t, vm_region_info_t,
+kern_return_t mach_vm_protect(vm_map_t targetTask, mach_vm_address_t, mach_vm_size_t, boolean_t setMaximum, vm_prot_t newProtection);
+kern_return_t mach_vm_region(vm_map_t targetTask, mach_vm_address_t*, mach_vm_size_t*, vm_region_flavor_t, vm_region_info_t,
                                       mach_msg_type_number_t* infoCount, mach_port_t* objectName);
-EXTERN_C kern_return_t mach_vm_region_recurse(vm_map_t targetTask, mach_vm_address_t*, mach_vm_size_t*, uint32_t* depth, vm_region_recurse_info_t, mach_msg_type_number_t* infoCount);
-EXTERN_C kern_return_t mach_vm_purgable_control(vm_map_t target, mach_vm_address_t, vm_purgable_t control, int* state);
+kern_return_t mach_vm_region_recurse(vm_map_t targetTask, mach_vm_address_t*, mach_vm_size_t*, uint32_t* depth, vm_region_recurse_info_t, mach_msg_type_number_t* infoCount);
+kern_return_t mach_vm_purgable_control(vm_map_t target, mach_vm_address_t, vm_purgable_t control, int* state);
+
+WTF_EXTERN_C_END
 
 #endif // MachVMSPI_h
index c3ff23d..f77fac0 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2014-2016 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -168,27 +168,31 @@ typedef enum {
 
 #endif
 
+WTF_EXTERN_C_BEGIN
+
 // FIXME: Declare these functions even when USE(APPLE_INTERNAL_SDK) is true once we can fix <rdar://problem/26584828> in a better way.
 #if !USE(APPLE_INTERNAL_SDK)
-EXTERN_C void CARenderServerCaptureLayerWithTransform(mach_port_t, uint32_t clientId, uint64_t layerId, uint32_t slotId, int32_t ox, int32_t oy, const CATransform3D*);
+void CARenderServerCaptureLayerWithTransform(mach_port_t, uint32_t clientId, uint64_t layerId, uint32_t slotId, int32_t ox, int32_t oy, const CATransform3D*);
 
 #if USE(IOSURFACE)
-EXTERN_C void CARenderServerRenderLayerWithTransform(mach_port_t server_port, uint32_t client_id, uint64_t layer_id, IOSurfaceRef, int32_t ox, int32_t oy, const CATransform3D*);
-EXTERN_C void CARenderServerRenderDisplayLayerWithTransformAndTimeOffset(mach_port_t, CFStringRef display_name, uint32_t client_id, uint64_t layer_id, IOSurfaceRef, int32_t ox, int32_t oy, const CATransform3D*, CFTimeInterval);
+void CARenderServerRenderLayerWithTransform(mach_port_t server_port, uint32_t client_id, uint64_t layer_id, IOSurfaceRef, int32_t ox, int32_t oy, const CATransform3D*);
+void CARenderServerRenderDisplayLayerWithTransformAndTimeOffset(mach_port_t, CFStringRef display_name, uint32_t client_id, uint64_t layer_id, IOSurfaceRef, int32_t ox, int32_t oy, const CATransform3D*, CFTimeInterval);
 #else
 typedef struct CARenderServerBuffer* CARenderServerBufferRef;
-EXTERN_C CARenderServerBufferRef CARenderServerCreateBuffer(size_t, size_t);
-EXTERN_C void CARenderServerDestroyBuffer(CARenderServerBufferRef);
-EXTERN_C size_t CARenderServerGetBufferWidth(CARenderServerBufferRef);
-EXTERN_C size_t CARenderServerGetBufferHeight(CARenderServerBufferRef);
-EXTERN_C size_t CARenderServerGetBufferRowBytes(CARenderServerBufferRef);
-EXTERN_C uint8_t* CARenderServerGetBufferData(CARenderServerBufferRef);
-EXTERN_C size_t CARenderServerGetBufferDataSize(CARenderServerBufferRef);
-
-EXTERN_C bool CARenderServerRenderLayerWithTransform(mach_port_t, uint32_t client_id, uint64_t layer_id, CARenderServerBufferRef, int32_t ox, int32_t oy, const CATransform3D*);
+CARenderServerBufferRef CARenderServerCreateBuffer(size_t, size_t);
+void CARenderServerDestroyBuffer(CARenderServerBufferRef);
+size_t CARenderServerGetBufferWidth(CARenderServerBufferRef);
+size_t CARenderServerGetBufferHeight(CARenderServerBufferRef);
+size_t CARenderServerGetBufferRowBytes(CARenderServerBufferRef);
+uint8_t* CARenderServerGetBufferData(CARenderServerBufferRef);
+size_t CARenderServerGetBufferDataSize(CARenderServerBufferRef);
+
+bool CARenderServerRenderLayerWithTransform(mach_port_t, uint32_t client_id, uint64_t layer_id, CARenderServerBufferRef, int32_t ox, int32_t oy, const CATransform3D*);
 #endif
 #endif
 
+WTF_EXTERN_C_END
+
 // FIXME: Move this into the APPLE_INTERNAL_SDK block once it's in an SDK.
 @interface CAContext (AdditionalDetails)
 #if PLATFORM(IOS) || (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101100)
@@ -196,6 +200,8 @@ EXTERN_C bool CARenderServerRenderLayerWithTransform(mach_port_t, uint32_t clien
 #endif
 @end
 
+WTF_EXTERN_C_BEGIN
+
 extern NSString * const kCATiledLayerRemoveImmediately;
 
 extern NSString * const kCAFilterColorInvert;
@@ -228,6 +234,8 @@ extern NSString * const kCAContextIgnoresHitTest;
 extern NSString * const kCAContentsFormatRGBA10XR;
 #endif
 
+WTF_EXTERN_C_END
+
 #if (PLATFORM(APPLETV) && __TV_OS_VERSION_MAX_ALLOWED < 100000) \
     || (PLATFORM(WATCHOS) && __WATCH_OS_VERSION_MAX_ALLOWED < 30000) \
     || (PLATFORM(IOS) && TARGET_OS_IOS && __IPHONE_OS_VERSION_MAX_ALLOWED < 100000) \
index dd1fec2..5b76f12 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2014-2016 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -59,20 +59,24 @@ typedef enum {
 
 #endif
 
-EXTERN_C CFTypeRef MGCopyAnswer(CFStringRef question, CFDictionaryRef options);
+WTF_EXTERN_C_BEGIN
+
+CFTypeRef MGCopyAnswer(CFStringRef question, CFDictionaryRef options);
 
 #ifndef MGGetBoolAnswer
-EXTERN_C bool MGGetBoolAnswer(CFStringRef question);
+bool MGGetBoolAnswer(CFStringRef question);
 #endif
 
 #ifndef MGGetSInt32Answer
-EXTERN_C SInt32 MGGetSInt32Answer(CFStringRef question, SInt32 defaultValue);
+SInt32 MGGetSInt32Answer(CFStringRef question, SInt32 defaultValue);
 #endif
 
 #ifndef MGGetFloat32Answer
-EXTERN_C Float32 MGGetFloat32Answer(CFStringRef question, Float32 defaultValue);
+Float32 MGGetFloat32Answer(CFStringRef question, Float32 defaultValue);
 #endif
 
+WTF_EXTERN_C_END
+
 #endif
 
 #endif // MobileGestaltSPI_h
index 691b246..5ea6a1e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2014-2016 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
 
 #endif
 
-EXTERN_C NSSet *QLPreviewGetSupportedMIMETypes();
-EXTERN_C NSString *QLTypeCopyBestMimeTypeForFileNameAndMimeType(NSString *fileName, NSString *mimeType);
-EXTERN_C NSString *QLTypeCopyBestMimeTypeForURLAndMimeType(NSURL *, NSString *mimeType);
-EXTERN_C NSString *QLTypeCopyUTIForURLAndMimeType(NSURL *, NSString *mimeType);
+WTF_EXTERN_C_BEGIN
+
+NSSet *QLPreviewGetSupportedMIMETypes();
+NSString *QLTypeCopyBestMimeTypeForFileNameAndMimeType(NSString *fileName, NSString *mimeType);
+NSString *QLTypeCopyBestMimeTypeForURLAndMimeType(NSURL *, NSString *mimeType);
+NSString *QLTypeCopyUTIForURLAndMimeType(NSURL *, NSString *mimeType);
+
+WTF_EXTERN_C_END
+
index 630c41e..5da2f5a 100644 (file)
 #include "config.h"
 #include "CoreTextSPIWin.h"
 
-extern "C" {
+WTF_EXTERN_C_BEGIN
 
 const CFStringRef kCTFontAttributeName = CFSTR("NSFont");
 const CFStringRef kCTForegroundColorFromContextAttributeName = CFSTR("CTForegroundColorFromContext");
 
-}
+WTF_EXTERN_C_END
 
index 97a7246..931519b 100644 (file)
@@ -29,7 +29,7 @@
 #include <CoreGraphics/CoreGraphics.h>
 #include <CoreText/CoreText.h>
 
-extern "C" {
+WTF_EXTERN_C_BEGIN
 
 typedef const struct __CTFont* CTFontRef;
 typedef const struct __CTLine* CTLineRef;
@@ -52,5 +52,5 @@ void CTLineDraw(CTLineRef, CGContextRef);
 CFDataRef CTFontCopyTable(CTFontRef, CTFontTableTag, CTFontTableOptions);
 CFArrayRef CTFontCopyAvailableTables(CTFontRef, CTFontTableOptions);
 
-}
+WTF_EXTERN_C_END
 
index 0f150e5..e0da4ef 100644 (file)
@@ -1,3 +1,14 @@
+2016-09-06  Daniel Bates  <dabates@apple.com>
+
+        Remove EXTERN_C from WTF
+        https://bugs.webkit.org/show_bug.cgi?id=161090
+
+        Reviewed by Brent Fulgham.
+
+        Guard external C declarations in WTF_EXTERN_C_BEGIN, WTF_EXTERN_C_END.
+
+        * Platform/spi/ios/ManagedConfigurationSPI.h:
+
 2016-09-06  Ryan Haddad  <ryanhaddad@apple.com>
 
         Unreviewed, rolling out r205407.
index b2c68d5..b4fd9d4 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2014-2016 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
 
 // FIXME: We conditionally enclose the ManagedConfiguration headers in an extern "C" linkage
 // block to make them suitable for C++ use.
-#ifdef __cplusplus
-extern "C" {
-#endif
+WTF_EXTERN_C_BEGIN
 
 #import <ManagedConfiguration/MCFeatures.h>
 #import <ManagedConfiguration/MCProfileConnection.h>
 
-#ifdef __cplusplus
-}
-#endif
+WTF_EXTERN_C_END
 
 #else