summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2015-03-21 17:08:34 -0400
committermidipix <writeonce@midipix.org>2015-03-21 17:08:34 -0400
commit5cefe360dd97e0efb3d994597dd40227961d7007 (patch)
tree30baa1fe3339895052e4653677074d9058c9682d
parent47407cf33ecab9f430fa663cbeb96016f64045f8 (diff)
downloadcbb-gcc-4.6.4-5cefe360dd97e0efb3d994597dd40227961d7007.tar.bz2
cbb-gcc-4.6.4-5cefe360dd97e0efb3d994597dd40227961d7007.tar.xz
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.
-rw-r--r--libc/cbb-common.h59
1 files changed, 59 insertions, 0 deletions
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 <features.h>
+#include <stdarg.h>
+#include <stdint.h>
+#include <stdio.h>
+#include <errno.h>
+
+
+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__ */