Skip to content

Commit 9c2614c

Browse files
authored
Fix building with tcc (#170)
- tcc doesn't support 128 bits integral types, use 64 bits math instead - suppress some unreachable code warnings
1 parent 148a205 commit 9c2614c

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

libbf.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
#include <stddef.h>
2828
#include <stdint.h>
2929

30-
#if INTPTR_MAX >= INT64_MAX && !defined(_WIN32)
30+
#if INTPTR_MAX >= INT64_MAX && !defined(_WIN32) && !defined(__TINYC__)
3131
#define LIMB_LOG2_BITS 6
3232
#else
3333
#define LIMB_LOG2_BITS 5

qjsc.c

+1
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@ static int js_module_dummy_init(JSContext *ctx, JSModuleDef *m)
178178
{
179179
/* should never be called when compiling JS code */
180180
abort();
181+
return -1; // pacify compiler
181182
}
182183

183184
static void find_unique_cname(char *cname, size_t cname_size)

quickjs.c

+3
Original file line numberDiff line numberDiff line change
@@ -2615,6 +2615,7 @@ static JSAtomKindEnum JS_AtomGetKind(JSContext *ctx, JSAtom v)
26152615
default:
26162616
abort();
26172617
}
2618+
return (JSAtomKindEnum){-1}; // pacify compiler
26182619
}
26192620

26202621
static BOOL JS_AtomIsString(JSContext *ctx, JSAtom v)
@@ -44106,6 +44107,7 @@ static JSWeakRefRecord **get_first_weak_ref(JSValueConst key)
4410644107
default:
4410744108
abort();
4410844109
}
44110+
return NULL; // pacify compiler
4410944111
}
4411044112

4411144113
static JSMapRecord *map_add_record(JSContext *ctx, JSMapState *s,
@@ -50142,6 +50144,7 @@ static JSValue js_dataview_getValue(JSContext *ctx,
5014250144
default:
5014350145
abort();
5014450146
}
50147+
return JS_EXCEPTION; // pacify compiler
5014550148
}
5014650149

5014750150
static JSValue js_dataview_setValue(JSContext *ctx,

0 commit comments

Comments
 (0)