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.
File:
1 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 */
Note: See TracChangeset for help on using the changeset viewer.