Add setjmp.h header
This commit is contained in:
parent
10221677e2
commit
b971bfb173
|
@ -3,10 +3,11 @@ $c_SRCDIR = $(TREE_PATH)/$c/src
|
|||
$c_HEADERDIR := $(TREE_PATH)/$c/include
|
||||
$c_OBJDIR := $(BUILD_PATH)/$c/obj
|
||||
|
||||
$c_HEADERS := assert.h ctype.h errno.h locale.h math.h signal.h stdio.h stdlib.h string.h time.h \
|
||||
$c_HEADERS := assert.h ctype.h errno.h locale.h math.h setjmp.h signal.h stdio.h stdlib.h \
|
||||
string.h time.h \
|
||||
mlibc/ensure.h
|
||||
|
||||
$c_OBJECTS := assert.o ctype.o locale.o math.o signal.o stdio.o stdlib.o string.o time.o
|
||||
$c_OBJECTS := assert.o ctype.o locale.o math.o setjmp.o signal.o stdio.o stdlib.o string.o time.o
|
||||
$c_OBJECT_PATHS := $(addprefix $($c_OBJDIR)/,$($c_OBJECTS))
|
||||
|
||||
$c_CXX := x86_64-managarm-g++
|
||||
|
|
21
libc/generic/ansi/include/setjmp.h
Normal file
21
libc/generic/ansi/include/setjmp.h
Normal file
|
@ -0,0 +1,21 @@
|
|||
|
||||
#ifndef _SETJMP_H
|
||||
#define _SETJMP_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
// [C11/7.13] Non-local jumps
|
||||
|
||||
typedef int jmp_buf[0];
|
||||
|
||||
__attribute__ (( returns_twice )) int setjmp(jmp_buf buffer);
|
||||
__attribute__ (( noreturn )) void longjmp(jmp_buf buffer, int value);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // _SETJMP_H
|
||||
|
15
libc/generic/ansi/src/setjmp.cpp
Normal file
15
libc/generic/ansi/src/setjmp.cpp
Normal file
|
@ -0,0 +1,15 @@
|
|||
|
||||
#include <setjmp.h>
|
||||
|
||||
#include <mlibc/ensure.h>
|
||||
|
||||
int setjmp(jmp_buf buffer) {
|
||||
__ensure(!"Not implemented");
|
||||
__builtin_unreachable();
|
||||
}
|
||||
|
||||
void longjmp(jmp_buf buffer, int value) {
|
||||
__ensure(!"Not implemented");
|
||||
__builtin_unreachable();
|
||||
}
|
||||
|
Loading…
Reference in a new issue