Fix building with tcc (#170)

- tcc doesn't support 128 bits integral types, use 64 bits math instead

- suppress some unreachable code warnings
This commit is contained in:
Ben Noordhuis 2023-12-03 13:36:51 +01:00 committed by GitHub
parent 148a205b71
commit 9c2614c2fa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 1 deletions

View file

@ -27,7 +27,7 @@
#include <stddef.h> #include <stddef.h>
#include <stdint.h> #include <stdint.h>
#if INTPTR_MAX >= INT64_MAX && !defined(_WIN32) #if INTPTR_MAX >= INT64_MAX && !defined(_WIN32) && !defined(__TINYC__)
#define LIMB_LOG2_BITS 6 #define LIMB_LOG2_BITS 6
#else #else
#define LIMB_LOG2_BITS 5 #define LIMB_LOG2_BITS 5

1
qjsc.c
View file

@ -178,6 +178,7 @@ static int js_module_dummy_init(JSContext *ctx, JSModuleDef *m)
{ {
/* should never be called when compiling JS code */ /* should never be called when compiling JS code */
abort(); abort();
return -1; // pacify compiler
} }
static void find_unique_cname(char *cname, size_t cname_size) static void find_unique_cname(char *cname, size_t cname_size)

View file

@ -2615,6 +2615,7 @@ static JSAtomKindEnum JS_AtomGetKind(JSContext *ctx, JSAtom v)
default: default:
abort(); abort();
} }
return (JSAtomKindEnum){-1}; // pacify compiler
} }
static BOOL JS_AtomIsString(JSContext *ctx, JSAtom v) static BOOL JS_AtomIsString(JSContext *ctx, JSAtom v)
@ -44106,6 +44107,7 @@ static JSWeakRefRecord **get_first_weak_ref(JSValueConst key)
default: default:
abort(); abort();
} }
return NULL; // pacify compiler
} }
static JSMapRecord *map_add_record(JSContext *ctx, JSMapState *s, static JSMapRecord *map_add_record(JSContext *ctx, JSMapState *s,
@ -50142,6 +50144,7 @@ static JSValue js_dataview_getValue(JSContext *ctx,
default: default:
abort(); abort();
} }
return JS_EXCEPTION; // pacify compiler
} }
static JSValue js_dataview_setValue(JSContext *ctx, static JSValue js_dataview_setValue(JSContext *ctx,