1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 12:07:45 +00:00

Userland: Guard set_jmp.h static_assert check to cpp impls only

This commit is contained in:
Dimenus 2021-08-30 17:20:10 -05:00 committed by Andreas Kling
parent 1700b6d113
commit de0861581e

View file

@ -48,6 +48,12 @@ struct __jmp_buf {
typedef struct __jmp_buf jmp_buf[1]; typedef struct __jmp_buf jmp_buf[1];
typedef struct __jmp_buf sigjmp_buf[1]; typedef struct __jmp_buf sigjmp_buf[1];
/**
* Since setjmp.h may be included in ports / c-projects, we need to guard this
*
*/
#ifdef __cplusplus
#ifdef __i386__ #ifdef __i386__
static_assert(sizeof(struct __jmp_buf) == 32, "struct __jmp_buf unsynchronized with i386/setjmp.S"); static_assert(sizeof(struct __jmp_buf) == 32, "struct __jmp_buf unsynchronized with i386/setjmp.S");
#elif __x86_64__ #elif __x86_64__
@ -57,6 +63,7 @@ static_assert(sizeof(struct __jmp_buf) == 184, "struct __jmp_buf unsynchronized
#else #else
#error #error
#endif #endif
#endif
/** /**
* Calling conventions mandates that sigsetjmp() cannot call setjmp(), * Calling conventions mandates that sigsetjmp() cannot call setjmp(),