r= rogerl@netscape.com
OS/2 changes for Mozilla - add #ifdef, change #ifdef
This commit is contained in:
mkaply%us.ibm.com 2000-03-15 14:31:55 +00:00
Родитель 438c8f8399
Коммит e859503601
5 изменённых файлов: 58 добавлений и 7 удалений

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

@ -3292,10 +3292,10 @@ JS_IsAssigning(JSContext *cx)
/************************************************************************/
#ifdef XP_PC
#include <windows.h>
#if defined(XP_OS2_HACK)
#if defined(XP_OS2)
/*DSR031297 - the OS/2 equiv is dll_InitTerm, but I don't see the need for it*/
#else
#include <windows.h>
/*
* Initialization routine for the JS DLL...
*/

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

@ -84,7 +84,7 @@
#elif defined(XP_PC)
#ifdef _WIN32
#if defined( _WIN32) || defined(XP_OS2)
#define IS_LITTLE_ENDIAN 1
#undef IS_BIG_ENDIAN
@ -128,7 +128,7 @@
#define JS_BYTES_PER_WORD_LOG2 2L
#define JS_BYTES_PER_DWORD_LOG2 3L
#define PR_WORDS_PER_DWORD_LOG2 1L
#endif /* _WIN32 */
#endif /* _WIN32 || XP_OS2 */
#if defined(_WINDOWS) && !defined(_WIN32) /* WIN16 */
#define IS_LITTLE_ENDIAN 1

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

@ -44,7 +44,7 @@
#ifdef XP_PC
#ifdef _WIN32
#if defined(_WIN32) || defined (XP_OS2)
#define JS_HAVE_LONG_LONG
#else
#undef JS_HAVE_LONG_LONG

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

@ -116,7 +116,7 @@ typedef struct JSXDRState JSXDRState;
typedef struct JSExceptionState JSExceptionState;
#ifndef CRT_CALL
#ifdef XP_OS2
#ifdef XP_OS2_VACPP
#define CRT_CALL _Optlink
#else
#define CRT_CALL

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

@ -449,10 +449,61 @@ if (!JSVAL_IS_NUMBER(jsvalue)) { \
java_value->member_name = member_name; \
}
#else
#ifdef XP_OS2
/* OS2 utility macro for jsj_ConvertJSValueToJavaValue(), below */
/* jlong is a structure, see jri_md.h, where the jlong_ macros are defined. */
#define JSVAL_TO_JLONG_JVALUE(member_name, member_type, jsvalue, java_value) \
if (!JSVAL_IS_NUMBER(jsvalue)) { \
if (!JS_ConvertValue(cx, jsvalue, JSTYPE_NUMBER, &jsvalue)) \
goto conversion_error; \
(*cost)++; \
} \
{ \
member_type member_name; \
\
if (JSVAL_IS_INT(jsvalue)) { \
jsint ival = JSVAL_TO_INT(jsvalue); \
jlong_I2L(member_name,ival); \
\
} else { \
jdouble dval = *JSVAL_TO_DOUBLE(jsvalue); \
\
/* NaN becomes zero when converted to integral value */ \
if (JSDOUBLE_IS_NaN(dval)) \
jlong_I2L(member_name,0); \
\
/* Unrepresentably large numbers, including infinities, */ \
/* cause an error. */ \
else if ((dval > member_type ## _MAX_VALUE) || \
(dval < member_type ## _MIN_VALUE)) { \
goto numeric_conversion_error; \
} else \
jlong_D2L(member_name,dval); \
\
/* Don't allow a non-integral number to be converted \
to an integral type */ \
/* Actually, we have to allow this for LC1 compatibility */ \
/*if (jlong_to_jdouble(member_name) != dval) \
(*cost)++;*/ \
} \
if (java_value) \
java_value->member_name = member_name; \
}
static jdouble jlong_to_jdouble(jlong lvalue)
{
jdouble d;
jlong_L2D(d,lvalue);
return d;
}
#else
#define jlong_to_jdouble(lvalue) ((jdouble) lvalue)
#endif
#endif
/*
@ -517,7 +568,7 @@ jsj_ConvertJSValueToJavaValue(JSContext *cx, JNIEnv *jEnv, jsval v_arg,
break;
case JAVA_SIGNATURE_LONG:
#if XP_MAC
#if defined(XP_MAC) || (defined(XP_OS2) && !defined(HAVE_LONG_LONG))
JSVAL_TO_JLONG_JVALUE(j, jlong, v, java_value);
#else
JSVAL_TO_INTEGRAL_JVALUE(long, j, jlong, v, java_value);