#ifdefs to build the JavaScript engine under metrowerks on windows machines.

Fixes courtesy Chris Dillman <chrisd@plaidworld.com>.

r=mccabe
a=sdagley
This commit is contained in:
mccabe%netscape.com 1999-12-22 00:03:50 +00:00
Родитель 0d5273560c
Коммит 7677f4e2f1
6 изменённых файлов: 34 добавлений и 6 удалений

Просмотреть файл

@ -1009,7 +1009,7 @@ JS_malloc(JSContext *cx, size_t nbytes)
cx->runtime->gcMallocBytes += nbytes;
#if defined(XP_OS2) || defined(XP_MAC) || defined(AIX) || defined(OSF1)
#if defined(XP_OS2) || defined(XP_MAC) || defined(AIX) || defined(OSF1) || defined(__MWERKS__)
if (nbytes == 0) /*DSR072897 - Windows allows this, OS/2 & Mac don't*/
nbytes = 1;
#endif

Просмотреть файл

@ -1566,7 +1566,7 @@ date_toLocaleString(JSContext *cx, JSObject *obj, uintN argc,
* full year be used in the result string.
*/
result_len = PRMJ_FormatTime(buf, sizeof buf,
#ifdef _WIN32
#if defined(_WIN32) && !defined(__MWERKS__)
"%#c",
#else
"%c",

Просмотреть файл

@ -51,7 +51,7 @@
* by default since there can be problems with endian-ness and such.
*/
#if defined(_WIN32)
#if defined(_WIN32) && !defined(__MWERKS__)
#define JS_USE_FDLIBM_MATH 1
#elif defined(SUNOS4)

Просмотреть файл

@ -381,6 +381,7 @@ js_InitNumberClass(JSContext *cx, JSObject *obj)
rt = cx->runtime;
if (!rt->jsNaN) {
#ifndef __MWERKS__
#ifdef XP_PC
#ifdef XP_OS2
/*DSR071597 - I have no idea what this really does other than mucking with the floating */
@ -393,8 +394,9 @@ js_InitNumberClass(JSContext *cx, JSObject *obj)
/* On Alpha platform this is handled via Compiler option */
_control87(MCW_EM, MCW_EM);
#endif
#endif
#endif
#endif /* XP_OS2 */
#endif /* XP_PC */
#endif /* __MWERKS__ */
u.s.hi = JSDOUBLE_HI32_EXPMASK | JSDOUBLE_HI32_MANTMASK;
u.s.lo = 0xffffffff;

Просмотреть файл

@ -72,6 +72,7 @@
**
***********************************************************************/
#ifdef WIN32
/* These also work for __MWERKS__ */
#define JS_EXTERN_API(__type) extern _declspec(dllexport) __type
#define JS_EXPORT_API(__type) _declspec(dllexport) __type
#define JS_EXTERN_DATA(__type) extern _declspec(dllexport) __type
@ -131,12 +132,16 @@
#endif
#ifdef _WIN32
# ifdef __MWERKS__
# define JS_IMPORT_API(__x) __x
# else
# define JS_IMPORT_API(__x) _declspec(dllimport) __x
# endif
#else
# define JS_IMPORT_API(__x) JS_EXPORT_API (__x)
#endif
#ifdef _WIN32
#if defined(_WIN32) && !defined(__MWERKS__)
# define JS_IMPORT_DATA(__x) _declspec(dllimport) __x
#else
# define JS_IMPORT_DATA(__x) __x

Просмотреть файл

@ -51,7 +51,12 @@
#define PRMJ_DO_MILLISECONDS 1
#ifdef XP_PC
#ifndef __MWERKS__
#include <sys/timeb.h>
#else
#include <WINDEF.H>
#include <WINBASE.H>
#endif
#endif
#ifdef XP_MAC
@ -267,7 +272,11 @@ PRMJ_Now(void)
{
#ifdef XP_PC
JSInt64 s, us, ms2us, s2us;
#ifndef __MWERKS__
struct timeb b;
#else
SYSTEMTIME time;
#endif /* __MWERKS__ */
#endif /* XP_PC */
#if defined(XP_UNIX) || defined(XP_BEOS)
struct timeval tv;
@ -283,6 +292,7 @@ PRMJ_Now(void)
#endif /* XP_MAC */
#ifdef XP_PC
#ifndef __MWERKS__
ftime(&b);
JSLL_UI2L(ms2us, PRMJ_USEC_PER_MSEC);
JSLL_UI2L(s2us, PRMJ_USEC_PER_SEC);
@ -292,6 +302,17 @@ PRMJ_Now(void)
JSLL_MUL(s, s, s2us);
JSLL_ADD(s, s, us);
return s;
#else
GetLocalTime(&time);
JSLL_UI2L(ms2us, PRMJ_USEC_PER_MSEC);
JSLL_UI2L(s2us, PRMJ_USEC_PER_SEC);
JSLL_UI2L(s, time.wSecond);
JSLL_UI2L(us, time.wMilliseconds);
JSLL_MUL(us, us, ms2us);
JSLL_MUL(s, s, s2us);
JSLL_ADD(s, s, us);
return s;
#endif /* __MWERKS__ */
#endif
#if defined(XP_UNIX) || defined(XP_BEOS)