Ignore:
Timestamp:
Nov 20, 2017, 6:48:14 PM (8 years ago)
Author:
[email protected]
Message:

Detect declspec within JSBase.h
https://bugs.webkit.org/show_bug.cgi?id=179892

Reviewed by Darin Adler.

  • API/JSBase.h:
File:
1 edited

Legend:

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

    r210053 r225063  
    6969typedef struct OpaqueJSValue* JSObjectRef;
    7070
     71/* Clang's __has_declspec_attribute emulation */
     72/* https://clang.llvm.org/docs/LanguageExtensions.html#has-declspec-attribute */
     73
     74#ifndef __has_declspec_attribute
     75#define __has_declspec_attribute(x) 0
     76#endif
     77
    7178/* JavaScript symbol exports */
    7279/* These rules should stay the same as in WebKit2/Shared/API/c/WKBase.h */
     
    7582#if defined(JS_NO_EXPORT)
    7683#define JS_EXPORT
    77 #elif defined(__GNUC__) && !defined(__CC_ARM) && !defined(__ARMCC__)
    78 #define JS_EXPORT __attribute__((visibility("default")))
    79 #elif defined(WIN32) || defined(_WIN32) || defined(_WIN32_WCE) || defined(__CC_ARM) || defined(__ARMCC__)
     84#elif defined(WIN32) || defined(_WIN32) || defined(__CC_ARM) || defined(__ARMCC__) || (__has_declspec_attribute(dllimport) && __has_declspec_attribute(dllexport))
    8085#if defined(BUILDING_JavaScriptCore) || defined(STATICALLY_LINKED_WITH_JavaScriptCore)
    8186#define JS_EXPORT __declspec(dllexport)
     
    8388#define JS_EXPORT __declspec(dllimport)
    8489#endif
     90#elif defined(__GNUC__)
     91#define JS_EXPORT __attribute__((visibility("default")))
    8592#else /* !defined(JS_NO_EXPORT) */
    8693#define JS_EXPORT
Note: See TracChangeset for help on using the changeset viewer.