--- a/upb/port/def.inc +++ b/upb/port/def.inc @@ -239,7 +239,7 @@ // Android uses a custom libc that does not implement all of posix, but it has // had sigsetjmp/siglongjmp forever on arm and since API 12 on x86. Apple has // sigsetjmp, but does not define the posix feature test macro. -#if defined(__APPLE__) || defined(_POSIX_C_SOURCE) || defined(__ANDROID__) +#if (defined(__APPLE__) || defined(_POSIX_C_SOURCE) || defined(__ANDROID__)) && !defined(__FreeBSD__) // avoid setting/restoring signal mask, which involves costly syscalls #define UPB_SETJMP(buf) sigsetjmp(buf, 0) #define UPB_LONGJMP(buf, val) siglongjmp(buf, val)