From 5cefe360dd97e0efb3d994597dd40227961d7007 Mon Sep 17 00:00:00 2001 From: midipix Date: Sat, 21 Mar 2015 17:08:34 -0400 Subject: compiler building blocks: common definitions. + cbb-common.h: this target-agnostic header must always be included when building cbb-gcc, but should have no effect on the code that is generated by the resulting toolchain. signed-off by Z. Gilboa; see copying.midipix (9cd0746c) for additional information. --- libc/cbb-common.h | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 libc/cbb-common.h (limited to 'libc') diff --git a/libc/cbb-common.h b/libc/cbb-common.h new file mode 100644 index 000000000..f07c7faed --- /dev/null +++ b/libc/cbb-common.h @@ -0,0 +1,59 @@ +/**************************************************/ +/* compiler building blocks: common definitions */ +/**************************************************/ + +#ifndef __ASSEMBLER__ + +#ifdef __cplusplus +extern "C" { +#endif + + +/* namespace */ +#ifndef _GNU_SOURCE +#define _GNU_SOURCE +#endif + + +/* a minimal, modernized libiberty */ +#include +#include +#include +#include +#include + + +void xexit(int status); +int xatexit(void (*function)(void)); +void * xcalloc(size_t, size_t); +void * xrealloc(void *, size_t); +char * xstrdup(const char *); +char * xstrndup(const char *, size_t); +char * xstrerror(int); + + +/* compatibility layer */ +#undef __GLIBC_PREREQ +#define __GLIBC_PREREQ (ig,nored) (1) + +#define _GLIBCXX_BEGIN_NAMESPACE_VERSION +#define _GLIBCXX_END_NAMESPACE_VERSION + +#define _GLIBCXX_VISIBILITY(V) __attribute__ ((__visibility__ (#V))) + + +#undef _GLIBCXX_C_LOCALE_GNU +#define _GLIBCXX_C_LOCALE_GNU (1) + +#undef __GCC_ATOMIC_INT_LOCK_FREE +#define __GCC_ATOMIC_INT_LOCK_FREE (2) + +#undef ATOMIC_INT_LOCK_FREE +#define ATOMIC_INT_LOCK_FREE __GCC_ATOMIC_INT_LOCK_FREE + + +#ifdef __cplusplus +} +#endif + +#endif /* __ASSEMBLER__ */ -- cgit v1.2.3