mirror of
https://github.com/janet-lang/janet
synced 2025-01-13 09:00:26 +00:00
Small changes to help with latest emscripten.
This commit is contained in:
parent
e528b86a2a
commit
21a355c89f
@ -57,7 +57,11 @@ JANET_THREAD_LOCAL jmp_buf *janet_vm_jmp_buf = NULL;
|
||||
/* How we dispatch instructions. By default, we use
|
||||
* a switch inside an infinite loop. For GCC/clang, we use
|
||||
* computed gotos. */
|
||||
#ifdef __GNUC__
|
||||
#if defined(__GNUC__) && !defined(EMSCRIPTEN)
|
||||
#define JANET_USE_COMPUTED_GOTOS
|
||||
#endif
|
||||
|
||||
#ifdef JANET_USE_COMPUTED_GOTOS
|
||||
#define VM_START() { goto *op_lookup[first_opcode];
|
||||
#define VM_END() }
|
||||
#define VM_OP(op) label_##op :
|
||||
@ -192,7 +196,7 @@ static Janet call_nonfn(JanetFiber *fiber, Janet callee) {
|
||||
static JanetSignal run_vm(JanetFiber *fiber, Janet in, JanetFiberStatus status) {
|
||||
|
||||
/* opcode -> label lookup if using clang/GCC */
|
||||
#ifdef __GNUC__
|
||||
#ifdef JANET_USE_COMPUTED_GOTOS
|
||||
static void *op_lookup[255] = {
|
||||
&&label_JOP_NOOP,
|
||||
&&label_JOP_ERROR,
|
||||
|
@ -238,9 +238,9 @@ typedef struct {
|
||||
#include <stdio.h>
|
||||
|
||||
/* Names of all of the types */
|
||||
JANET_API const char *const janet_type_names[16];
|
||||
JANET_API const char *const janet_signal_names[14];
|
||||
JANET_API const char *const janet_status_names[16];
|
||||
JANET_API extern const char *const janet_type_names[16];
|
||||
JANET_API extern const char *const janet_signal_names[14];
|
||||
JANET_API extern const char *const janet_status_names[16];
|
||||
|
||||
/* Fiber signals */
|
||||
typedef enum {
|
||||
|
Loading…
Reference in New Issue
Block a user