Changeset View
Changeset View
Standalone View
Standalone View
libraries/source/spidermonkey/include-win32-debug/jstypes.h
Show First 20 Lines • Show All 64 Lines • ▼ Show 20 Lines | |||||
* The linkage of JS API functions differs depending on whether the file is | * The linkage of JS API functions differs depending on whether the file is | ||||
* used within the JS library or not. Any source file within the JS | * used within the JS library or not. Any source file within the JS | ||||
* interpreter should define EXPORT_JS_API whereas any client of the library | * interpreter should define EXPORT_JS_API whereas any client of the library | ||||
* should not. STATIC_JS_API is used to build JS as a static library. | * should not. STATIC_JS_API is used to build JS as a static library. | ||||
*/ | */ | ||||
#if defined(STATIC_JS_API) | #if defined(STATIC_JS_API) | ||||
# define JS_PUBLIC_API(t) t | # define JS_PUBLIC_API(t) t | ||||
# define JS_PUBLIC_DATA(t) t | # define JS_PUBLIC_DATA(t) t | ||||
# define JS_FRIEND_API(t) t | |||||
# define JS_FRIEND_DATA(t) t | |||||
#elif defined(EXPORT_JS_API) || defined(STATIC_EXPORTABLE_JS_API) | #elif defined(EXPORT_JS_API) || defined(STATIC_EXPORTABLE_JS_API) | ||||
# define JS_PUBLIC_API(t) MOZ_EXPORT t | # define JS_PUBLIC_API(t) MOZ_EXPORT t | ||||
# define JS_PUBLIC_DATA(t) MOZ_EXPORT t | # define JS_PUBLIC_DATA(t) MOZ_EXPORT t | ||||
#else | |||||
# define JS_PUBLIC_API(t) MOZ_IMPORT_API t | |||||
# define JS_PUBLIC_DATA(t) MOZ_IMPORT_DATA t | |||||
#endif | |||||
#if defined(STATIC_JS_API) || defined(EXPORT_JS_API) || defined(STATIC_EXPORTABLE_JS_API) | |||||
# define JS_FRIEND_API(t) MOZ_EXPORT t | # define JS_FRIEND_API(t) MOZ_EXPORT t | ||||
# define JS_FRIEND_DATA(t) MOZ_EXPORT t | # define JS_FRIEND_DATA(t) MOZ_EXPORT t | ||||
#else | #else | ||||
# define JS_PUBLIC_API(t) MOZ_IMPORT_API t | |||||
# define JS_PUBLIC_DATA(t) MOZ_IMPORT_DATA t | |||||
# define JS_FRIEND_API(t) MOZ_IMPORT_API t | # define JS_FRIEND_API(t) MOZ_IMPORT_API t | ||||
# define JS_FRIEND_DATA(t) MOZ_IMPORT_DATA t | # define JS_FRIEND_DATA(t) MOZ_IMPORT_DATA t | ||||
#endif | #endif | ||||
#if defined(_MSC_VER) && defined(_M_IX86) | #if defined(_MSC_VER) && defined(_M_IX86) | ||||
#define JS_FASTCALL __fastcall | #define JS_FASTCALL __fastcall | ||||
#elif defined(__GNUC__) && defined(__i386__) | #elif defined(__GNUC__) && defined(__i386__) | ||||
#define JS_FASTCALL __attribute__((fastcall)) | #define JS_FASTCALL __attribute__((fastcall)) | ||||
#else | #else | ||||
#define JS_FASTCALL | #define JS_FASTCALL | ||||
#define JS_NO_FASTCALL | #define JS_NO_FASTCALL | ||||
#endif | #endif | ||||
// gcc is buggy and warns on our attempts to JS_PUBLIC_API our | |||||
// forward-declarations or explicit template instantiations. See | |||||
// <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=50044>. Add a way to detect | |||||
// that so we can locally disable that warning. | |||||
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ < 6 || (__GNUC__ == 6 && __GNUC_MINOR__ <= 4)) | |||||
#define JS_BROKEN_GCC_ATTRIBUTE_WARNING | |||||
#endif | |||||
/*********************************************************************** | /*********************************************************************** | ||||
** MACROS: JS_BEGIN_MACRO | ** MACROS: JS_BEGIN_MACRO | ||||
** JS_END_MACRO | ** JS_END_MACRO | ||||
** DESCRIPTION: | ** DESCRIPTION: | ||||
** Macro body brackets so that macros with compound statement definitions | ** Macro body brackets so that macros with compound statement definitions | ||||
** behave syntactically more like functions when called. | ** behave syntactically more like functions when called. | ||||
***********************************************************************/ | ***********************************************************************/ | ||||
#define JS_BEGIN_MACRO do { | #define JS_BEGIN_MACRO do { | ||||
▲ Show 20 Lines • Show All 116 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator