Initial C++ runtime work. Much more to do.
This commit is contained in:
4
include/assert.h
Normal file
4
include/assert.h
Normal file
@ -0,0 +1,4 @@
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
|
||||
#define assert( e ) KASSERT( (e), "Assertion failure" )
|
1
include/ctype.h
Normal file
1
include/ctype.h
Normal file
@ -0,0 +1 @@
|
||||
#include <sys/ctype.h>
|
1
include/errno.h
Normal file
1
include/errno.h
Normal file
@ -0,0 +1 @@
|
||||
#include <sys/errno.h>
|
0
include/limits.h
Normal file
0
include/limits.h
Normal file
0
include/stdbool.h
Normal file
0
include/stdbool.h
Normal file
23
include/stddef.h
Normal file
23
include/stddef.h
Normal file
@ -0,0 +1,23 @@
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
#include <sys/types.h>
|
||||
#include <sys/stddef.h>
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
#undef NULL
|
||||
#define NULL (nullptr)
|
||||
#else
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
namespace std
|
||||
{
|
||||
using size_t= ::size_t;
|
||||
using ptrdiff_t= ::ptrdiff_t;
|
||||
}
|
||||
#endif
|
1
include/stdint.h
Normal file
1
include/stdint.h
Normal file
@ -0,0 +1 @@
|
||||
#include <sys/stdint.h>
|
0
include/stdio.h
Normal file
0
include/stdio.h
Normal file
33
include/stdlib.h
Normal file
33
include/stdlib.h
Normal file
@ -0,0 +1,33 @@
|
||||
#include <stddef.h>
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
#include <sys/libkern.h>
|
||||
#include <sys/malloc.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
namespace cxxruntime
|
||||
{
|
||||
|
||||
extern void *malloc( std::size_t );
|
||||
extern void *realloc(void *, std::size_t);
|
||||
extern void free(void *);
|
||||
}
|
||||
#define __extern_c extern "C"
|
||||
#else
|
||||
#define __extern_c extern
|
||||
#endif
|
||||
|
||||
__extern_c void *cxxruntime_malloc(size_t);
|
||||
|
||||
__extern_c void *cxxruntime_realloc(void *, size_t);
|
||||
__extern_c void cxxruntime_free(void *);
|
||||
|
||||
__extern_c char *cxxruntime_strdup(const char *);
|
||||
__extern_c void abort() __attribute__(( __noreturn__ ));
|
0
include/string.h
Normal file
0
include/string.h
Normal file
Reference in New Issue
Block a user