aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDJ Delorie <dj@redhat.com>2000-11-29 20:14:48 +0000
committerDJ Delorie <dj@redhat.com>2000-11-29 20:14:48 +0000
commit1ad02eaa81469e2a37197663bdcf1cd1b83f7d37 (patch)
tree42df57c6b87a928c4982a3bfb70a850a79275c2f
parent38c5dd446ee8840cec2dfcad84379d81412975f5 (diff)
downloadnewlib-1ad02eaa81469e2a37197663bdcf1cd1b83f7d37.zip
newlib-1ad02eaa81469e2a37197663bdcf1cd1b83f7d37.tar.gz
newlib-1ad02eaa81469e2a37197663bdcf1cd1b83f7d37.tar.bz2
* libiberty.h: Move #includes to top. Prototype xmalloc_failed.
-rw-r--r--include/ChangeLog4
-rw-r--r--include/libiberty.h16
2 files changed, 14 insertions, 6 deletions
diff --git a/include/ChangeLog b/include/ChangeLog
index 1b978a7..a7a115b 100644
--- a/include/ChangeLog
+++ b/include/ChangeLog
@@ -1,3 +1,7 @@
+2000-11-29 Zack Weinberg <zack@wolery.stanford.edu>
+
+ * libiberty.h: Move #includes to top. Prototype xmalloc_failed.
+
2000-11-15 Kenneth Block <kenneth.block@compaq.com>
* demangle.h: Add gnat and java demangle styles.
diff --git a/include/libiberty.h b/include/libiberty.h
index e6eb347..64d072b 100644
--- a/include/libiberty.h
+++ b/include/libiberty.h
@@ -16,6 +16,13 @@ extern "C" {
#include "ansidecl.h"
+#ifdef ANSI_PROTOTYPES
+/* Get a definition for size_t. */
+#include <stddef.h>
+/* Get a definition for va_list. */
+#include <stdarg.h>
+#endif
+
/* Build an argument vector from a string. Allocates memory using
malloc. Use freeargv to free the vector. */
@@ -130,16 +137,13 @@ extern void xexit PARAMS ((int status)) ATTRIBUTE_NORETURN;
extern void xmalloc_set_program_name PARAMS ((const char *));
+/* Report an allocation failure. */
+extern void xmalloc_failed PARAMS ((size_t)) ATTRIBUTE_NORETURN;
+
/* Allocate memory without fail. If malloc fails, this will print a
message to stderr (using the name set by xmalloc_set_program_name,
if any) and then call xexit. */
-#ifdef ANSI_PROTOTYPES
-/* Get a definition for size_t. */
-#include <stddef.h>
-/* Get a definition for va_list. */
-#include <stdarg.h>
-#endif
extern PTR xmalloc PARAMS ((size_t)) ATTRIBUTE_MALLOC;
/* Reallocate memory without fail. This works like xmalloc. Note,