Skip to content

Commit

Permalink
[SjLj] __USING_WASM_SJLJ__ -> __WASM_SJLJ__ (emscripten-core#21971)
Browse files Browse the repository at this point in the history
In line with emscripten-core#21970, this changes `__USING_WASM_SJLJ__` to
`__WASM_SJLJ__`. We don't define this in Clang now (which we can maybe
consider, but given that Clang doesn't have dedicated flags for SjLj and
there don't seem to be other platforms doing similar things), but given
that the affected files currently are only in Emscripten, I think we can
safely change this.
  • Loading branch information
aheejin authored Jan 8, 2025
1 parent 32e1daf commit 9096999
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions system/lib/compiler-rt/emscripten_setjmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

#include "emscripten_internal.h"

#ifdef __USING_WASM_SJLJ__
#ifdef __WASM_SJLJ__
struct __WasmLongjmpArgs {
void *env;
int val;
Expand All @@ -25,7 +25,7 @@ struct __WasmLongjmpArgs {
struct jmp_buf_impl {
void* func_invocation_id;
uint32_t label;
#ifdef __USING_WASM_SJLJ__
#ifdef __WASM_SJLJ__
struct __WasmLongjmpArgs arg;
#endif
};
Expand All @@ -48,7 +48,7 @@ uint32_t __wasm_setjmp_test(void* env, void* func_invocation_id) {
return 0;
}

#ifdef __USING_WASM_SJLJ__
#ifdef __WASM_SJLJ__
// llvm uses `1` for the __c_longjmp tag.
// See https://github.com/llvm/llvm-project/blob/main/llvm/include/llvm/CodeGen/WasmEHFuncInfo.h
#define C_LONGJMP 1
Expand Down
2 changes: 1 addition & 1 deletion tools/system_libs.py
Original file line number Diff line number Diff line change
Expand Up @@ -852,7 +852,7 @@ def get_cflags(self):
# EH/SjLj, so we should reverse it.
cflags += ['-sSUPPORT_LONGJMP=wasm',
'-sDISABLE_EXCEPTION_THROWING',
'-D__USING_WASM_SJLJ__']
'-D__WASM_SJLJ__']
return cflags

def get_base_name(self):
Expand Down

0 comments on commit 9096999

Please sign in to comment.