1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-10-05 04:24:03 -04:00

SMJS: Define XP_UNIX and others as 1, not as empty

This change is intended to prevent a macro redefinition warning
if CFLAGS already contains -DXP_UNIX from pkg-config --cflags mozilla-js.
This commit is contained in:
Kalle Olavi Niemitalo 2011-05-01 23:41:44 +03:00 committed by Kalle Olavi Niemitalo
parent e22eae2e93
commit 8a89a627bc

View File

@ -1,17 +1,22 @@
#ifndef EL__ECMASCRIPT_SPIDERMONKEY_SHARED_H
#define EL__ECMASCRIPT_SPIDERMONKEY_SHARED_H
/* For wild SpiderMonkey installations. */
/* Tell SpiderMonkey headers which operating system will be used.
* With standalone SpiderMonkey 1.8.5, "pkg-config --cflags mozjs185"
* does not define such a macro, so ELinks must do that here.
* With xulrunner 2.0 however, "pkg-config --cflags mozilla-js"
* already outputs -DXP_UNIX or similar. To prevent a warning about
* macro redefinition, define the macro as 1, like -D does. */
#ifdef CONFIG_OS_BEOS
#define XP_BEOS
#define XP_BEOS 1
#elif CONFIG_OS_OS2
#define XP_OS2
#define XP_OS2 1
#elif CONFIG_OS_RISCOS
#error Out of luck, buddy!
#elif CONFIG_OS_UNIX
#define XP_UNIX
#define XP_UNIX 1
#elif CONFIG_OS_WIN32
#define XP_WIN
#define XP_WIN 1
#endif
#include <jsapi.h>