From a1f74f9f2239d92c3eebb816731ff3c3d73dda8e Mon Sep 17 00:00:00 2001 From: TAiGA <> Date: Thu, 23 May 2024 15:50:48 +0800 Subject: [PATCH] Fix --- quickjs.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/quickjs.h b/quickjs.h index 46db704..767004a 100644 --- a/quickjs.h +++ b/quickjs.h @@ -93,6 +93,12 @@ typedef struct JSRefCountHeader { #define JS_FLOAT64_NAN NAN +#if defined(_MSC_VER) +#define JS_VALUE_CAST(t, v) v +#else +#define JS_VALUE_CAST(t, v) (t)v +#endif + #ifdef CONFIG_CHECK_JSVALUE /* JSValue consistency : it is not possible to run the code in this mode, but it is useful to detect simple reference counting @@ -207,12 +213,6 @@ typedef struct JSValue { #define JSValueConst JSValue -#if defined(_MSC_VER) -#define JS_VALUE_CAST(t, v) v -#else -#define JS_VALUE_CAST(t, v) (t)v -#endif - #define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag) /* same as JS_VALUE_GET_TAG, but return JS_TAG_FLOAT64 with NaN boxing */ #define JS_VALUE_GET_NORM_TAG(v) JS_VALUE_GET_TAG(v)