diff --git a/php/ext/google/protobuf/php-upb.c b/php/ext/google/protobuf/php-upb.c index 1c2a08e6ef..69ebac742f 100644 --- a/php/ext/google/protobuf/php-upb.c +++ b/php/ext/google/protobuf/php-upb.c @@ -43,6 +43,7 @@ #include #include #include +#include #ifndef UINTPTR_MAX Error, UINTPTR_MAX is undefined @@ -171,6 +172,9 @@ Error, UINTPTR_MAX is undefined #ifdef __APPLE__ #define UPB_SETJMP(buf) _setjmp(buf) #define UPB_LONGJMP(buf, val) _longjmp(buf, val) +#elif defined(WASM_WAMR) +#define UPB_SETJMP(buf) 0 +#define UPB_LONGJMP(buf, val) abort() #else #define UPB_SETJMP(buf) setjmp(buf) #define UPB_LONGJMP(buf, val) longjmp(buf, val) diff --git a/php/ext/google/protobuf/php-upb.h b/php/ext/google/protobuf/php-upb.h index 1759578d9e..d4bf5cfa63 100644 --- a/php/ext/google/protobuf/php-upb.h +++ b/php/ext/google/protobuf/php-upb.h @@ -42,6 +42,7 @@ #include #include #include +#include #ifndef UINTPTR_MAX Error, UINTPTR_MAX is undefined @@ -170,6 +171,9 @@ Error, UINTPTR_MAX is undefined #ifdef __APPLE__ #define UPB_SETJMP(buf) _setjmp(buf) #define UPB_LONGJMP(buf, val) _longjmp(buf, val) +#elif defined(WASM_WAMR) +#define UPB_SETJMP(buf) 0 +#define UPB_LONGJMP(buf, val) abort() #else #define UPB_SETJMP(buf) setjmp(buf) #define UPB_LONGJMP(buf, val) longjmp(buf, val) diff --git a/ruby/ext/google/protobuf_c/ruby-upb.c b/ruby/ext/google/protobuf_c/ruby-upb.c index 0349a1c267..76b79e6d51 100644 --- a/ruby/ext/google/protobuf_c/ruby-upb.c +++ b/ruby/ext/google/protobuf_c/ruby-upb.c @@ -43,6 +43,7 @@ #include #include #include +#include #ifndef UINTPTR_MAX Error, UINTPTR_MAX is undefined @@ -171,6 +172,9 @@ Error, UINTPTR_MAX is undefined #ifdef __APPLE__ #define UPB_SETJMP(buf) _setjmp(buf) #define UPB_LONGJMP(buf, val) _longjmp(buf, val) +#elif defined(WASM_WAMR) +#define UPB_SETJMP(buf) 0 +#define UPB_LONGJMP(buf, val) abort() #else #define UPB_SETJMP(buf) setjmp(buf) #define UPB_LONGJMP(buf, val) longjmp(buf, val) diff --git a/ruby/ext/google/protobuf_c/ruby-upb.h b/ruby/ext/google/protobuf_c/ruby-upb.h index fb75f3d525..fbdd1fa04b 100755 --- a/ruby/ext/google/protobuf_c/ruby-upb.h +++ b/ruby/ext/google/protobuf_c/ruby-upb.h @@ -44,6 +44,7 @@ #include #include #include +#include #ifndef UINTPTR_MAX Error, UINTPTR_MAX is undefined @@ -172,6 +173,9 @@ Error, UINTPTR_MAX is undefined #ifdef __APPLE__ #define UPB_SETJMP(buf) _setjmp(buf) #define UPB_LONGJMP(buf, val) _longjmp(buf, val) +#elif defined(WASM_WAMR) +#define UPB_SETJMP(buf) 0 +#define UPB_LONGJMP(buf, val) abort() #else #define UPB_SETJMP(buf) setjmp(buf) #define UPB_LONGJMP(buf, val) longjmp(buf, val)