move FIRM_NOTHROW, FIRM_PRINTF to obstack.h header
[libfirm] / include / libfirm / adt / xmalloc.h
index f378ff0..5a8c3b6 100644 (file)
  * @file
  * @brief       never failing wrappers for malloc() & friends.
  * @author      Markus Armbruster
- * @version     $Id$
  * @note        The functions here never fail because they simply abort your
  *              program in case of an error.
  */
 #ifndef FIRM_ADT_XMALLOC_H
 #define FIRM_ADT_XMALLOC_H
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 #include <stddef.h>
 #include <stdlib.h>
+#include <string.h>
+
+/* Includes for alloca() */
+#ifdef _WIN32
+#include <malloc.h>
+#endif
+
+#include "../begin.h"
 
 /* xmalloc() & friends. */
 
-void *xmalloc(size_t size);
-void *xrealloc(void *ptr, size_t size);
-char *xstrdup(const char *str);
+FIRM_API void *xmalloc(size_t size);
+FIRM_API void *xrealloc(void *ptr, size_t size);
+FIRM_API char *xstrdup(const char *str);
 
 #define xfree(ptr)      free(ptr)
 
@@ -122,16 +125,6 @@ char *xstrdup(const char *str);
 #define OALLOCFZ(obst, type, member, n) ((type*)memset(OALLOCF((obst), type, member, (n)), 0, offsetof(type, member) + sizeof(*((type*)0)->member) * (n)))
 
 
-/* Includes for alloca() */
-#ifdef _WIN32
-#include <malloc.h>
-#endif
-#ifdef HAVE_ALLOCA_H
-#include <alloca.h>
-#endif
-
-#ifdef __cplusplus
-}
-#endif
+#include "../end.h"
 
 #endif