Changeset 174110 in webkit for trunk/Source/JavaScriptCore/API


Ignore:
Timestamp:
Sep 30, 2014, 11:40:32 AM (11 years ago)
Author:
[email protected]
Message:

REGRESSION (r172532): JSBase.h declares NSMapTable functions that are SPI
https://bugs.webkit.org/show_bug.cgi?id=137170
<rdar://problem/18477384>

Reviewed by Geoffrey Garen.

Source/JavaScriptCore:

Move conditional include of header Foundation/NSMapTablePriv.h and forward declarations
of NSMapTable SPI from file JavaScriptCore/API/JSBase.h to WTF/wtf/spi/cocoa/NSMapTableSPI.h.

  • API/JSBase.h:
  • API/JSManagedValue.mm: Include header WTF/wtf/spi/cocoa/NSMapTableSPI.h.
  • API/JSVirtualMachine.mm: Ditto.
  • API/JSVirtualMachineInternal.h: Forward declare class NSMapTable.
  • API/JSWrapperMap.mm: Include header WTF/wtf/spi/cocoa/NSMapTableSPI.h. Also, order

#include directives such that they are sorted in alphabetical order.

Source/WTF:

Add SPI wrapper header, NSMapTableSPI.h.

Additionally, define convenience macro EXTERN_C that can be used to specify the C linkage
convention for a declaration. For example, the declaration "EXTERN_C const int x;" will
expand to:

extern const int x;

and

extern "C" const int x;

when used in a C and C++ file, respectively.

  • WTF.xcodeproj/project.pbxproj:
  • wtf/Compiler.h:
  • wtf/spi/cocoa/NSMapTableSPI.h: Added.
Location:
trunk/Source/JavaScriptCore/API
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/API/JSBase.h

    r174108 r174110  
    3333#ifdef __OBJC__
    3434#import <Foundation/Foundation.h>
    35 
    36 #if defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE
    37 #if __has_include(<Foundation/NSMapTablePriv.h>)
    38 #import <Foundation/NSMapTablePriv.h>
    39 #else
    40 
    41 #ifndef __cplusplus
    42 extern "C" {
    4335#endif
    44     void *NSMapGet(NSMapTable *, const void *key);
    45     void NSMapInsert(NSMapTable *, const void *key, const void *value);
    46     void NSMapRemove(NSMapTable *, const void *key);
    47 
    48 #ifndef __cplusplus
    49 }
    50 #endif
    51 #endif
    52 #endif // defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE
    53 #endif // __OBJC__
    5436
    5537/* JavaScript engine interface */
  • trunk/Source/JavaScriptCore/API/JSManagedValue.mm

    r165607 r174110  
    3838#import "ObjcRuntimeExtras.h"
    3939#import "JSCInlines.h"
     40#import <wtf/spi/cocoa/NSMapTableSPI.h>
    4041
    4142class JSManagedValueHandleOwner : public JSC::WeakHandleOwner {
  • trunk/Source/JavaScriptCore/API/JSVirtualMachine.mm

    r167326 r174110  
    3838#import <mutex>
    3939#import <wtf/NeverDestroyed.h>
     40#import <wtf/spi/cocoa/NSMapTableSPI.h>
    4041
    4142static NSMapTable *globalWrapperCache = 0;
  • trunk/Source/JavaScriptCore/API/JSVirtualMachineInternal.h

    r167326 r174110  
    3737
    3838#if defined(__OBJC__)
     39@class NSMapTable;
     40
    3941@interface JSVirtualMachine(Internal)
    4042
  • trunk/Source/JavaScriptCore/API/JSWrapperMap.mm

    r171564 r174110  
    3131#import "APICast.h"
    3232#import "JSAPIWrapperObject.h"
     33#import "JSCInlines.h"
    3334#import "JSCallbackObject.h"
    3435#import "JSContextInternal.h"
     
    3637#import "ObjCCallbackFunction.h"
    3738#import "ObjcRuntimeExtras.h"
    38 #import "JSCInlines.h"
    3939#import "WeakGCMap.h"
     40#import <wtf/HashSet.h>
    4041#import <wtf/TCSpinLock.h>
    4142#import <wtf/Vector.h>
    42 #import <wtf/HashSet.h>
     43#import <wtf/spi/cocoa/NSMapTableSPI.h>
    4344
    4445#include <mach-o/dyld.h>
Note: See TracChangeset for help on using the changeset viewer.