Removes setjmp/longjmp if UPB is running in a WASM-WAMR environment

PiperOrigin-RevId: 658841466
pull/17667/head
Protobuf Team Bot 4 months ago committed by Copybara-Service
parent f26bdff7cc
commit 580b595eea
  1. 4
      upb/port/def.inc

@ -47,6 +47,7 @@
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#ifndef UINTPTR_MAX
Error, UINTPTR_MAX is undefined
@ -175,6 +176,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)

Loading…
Cancel
Save