Initial C++ runtime work. Much more to do.

This commit is contained in:
2015-05-02 23:32:01 -04:00
parent 772476ea85
commit db2bda84c8
35 changed files with 7920 additions and 0 deletions

33
include/stdlib.h Normal file
View 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__ ));