* hashtab.c, partition.c, sort.c, xmemdup.c: Include string.h
if HAVE_STRING_H.
* pexecute.c, xexit.c: Include stdlib.h if HAVE_STDLIB_H.
* objalloc.c: Include config.h. Include stdlib.h and don't
declare malloc or free if HAVE_STDLIB_H.
* strerror.c, strsignal.c: Include stdlib.h if HAVE_STDLIB_H,
else declare malloc without prototype. Include string.h if
HAVE_STRING_H, else declare memset without prototype. Don't
include stddef.h.
From-SVN: r34254
+2000-05-29 Zack Weinberg <zack@wolery.cumb.org>
+
+ * hashtab.c, partition.c, sort.c, xmemdup.c: Include string.h
+ if HAVE_STRING_H.
+ * pexecute.c, xexit.c: Include stdlib.h if HAVE_STDLIB_H.
+ * objalloc.c: Include config.h. Include stdlib.h and don't
+ declare malloc or free if HAVE_STDLIB_H.
+ * strerror.c, strsignal.c: Include stdlib.h if HAVE_STDLIB_H,
+ else declare malloc without prototype. Include string.h if
+ HAVE_STRING_H, else declare memset without prototype. Don't
+ include stddef.h.
+
2000-05-23 Mike Stump <mrs@wrs.com>
* Makefile.in (xmalloc.o): Add dependency for config.h, fixes make
2000-05-23 Mike Stump <mrs@wrs.com>
* Makefile.in (xmalloc.o): Add dependency for config.h, fixes make
#include <stdlib.h>
#endif
#include <stdlib.h>
#endif
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+
#include <stdio.h>
#include "libiberty.h"
#include <stdio.h>
#include "libiberty.h"
Boston, MA 02111-1307, USA. */
#include "ansidecl.h"
Boston, MA 02111-1307, USA. */
#include "ansidecl.h"
#include "objalloc.h"
/* Get a definition for NULL. */
#include "objalloc.h"
/* Get a definition for NULL. */
#include <stddef.h>
#endif
#include <stddef.h>
#endif
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#else
/* For systems with larger pointers than ints, this must be declared. */
extern PTR malloc PARAMS ((size_t));
extern void free PARAMS ((PTR));
#endif
/* For systems with larger pointers than ints, this must be declared. */
extern PTR malloc PARAMS ((size_t));
extern void free PARAMS ((PTR));
#endif
/* These routines allocate space for an object. Freeing allocated
space may or may not free all more recently allocated space.
/* These routines allocate space for an object. Freeing allocated
space may or may not free all more recently allocated space.
#include <stdlib.h>
#endif
#include <stdlib.h>
#endif
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+
#include "libiberty.h"
#include "partition.h"
#include "libiberty.h"
#include "partition.h"
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
#define ISSPACE (x) isspace(x)
#ifdef HAVE_SYS_WAIT_H
#include <sys/wait.h>
#define ISSPACE (x) isspace(x)
#ifdef HAVE_SYS_WAIT_H
#include <sys/wait.h>
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
#ifndef UCHAR_MAX
#define UCHAR_MAX ((unsigned char)(-1))
#ifndef UCHAR_MAX
#define UCHAR_MAX ((unsigned char)(-1))
/* Routines imported from standard C runtime libraries. */
/* Routines imported from standard C runtime libraries. */
-#ifdef __STDC__
-#include <stddef.h>
-extern void *malloc (size_t size); /* 4.10.3.3 */
-extern void *memset (void *s, int c, size_t n); /* 4.11.6.1 */
-#else /* !__STDC__ */
-extern char *malloc (); /* Standard memory allocater */
-extern char *memset ();
-#endif /* __STDC__ */
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#else
+extern PTR malloc ();
+#endif
+
+#ifdef HAVE_STRING_H
+#include <string.h>
+#else
+extern PTR memset ();
+#endif
#ifndef MAX
# define MAX(a,b) ((a) > (b) ? (a) : (b))
#ifndef MAX
# define MAX(a,b) ((a) > (b) ? (a) : (b))
/* Routines imported from standard C runtime libraries. */
/* Routines imported from standard C runtime libraries. */
-#ifdef __STDC__
-#include <stddef.h>
-extern void *malloc (size_t size); /* 4.10.3.3 */
-extern void *memset (void *s, int c, size_t n); /* 4.11.6.1 */
-#else /* !__STDC__ */
-extern char *malloc (); /* Standard memory allocater */
-extern char *memset ();
-#endif /* __STDC__ */
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#else
+extern PTR malloc ();
+#endif
+
+#ifdef HAVE_STRING_H
+#include <string.h>
+#else
+extern PTR memset ();
+#endif
/* Undefine the macro we used to hide the definition of sys_siglist
found in the system header files. */
/* Undefine the macro we used to hide the definition of sys_siglist
found in the system header files. */
#include "libiberty.h"
#include <stdio.h>
#include "libiberty.h"
#include <stdio.h>
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
/* This variable is set by xatexit if it is called. This way, xmalloc
doesn't drag xatexit into the link. */
/* This variable is set by xatexit if it is called. This way, xmalloc
doesn't drag xatexit into the link. */
#include "libiberty.h"
#include <sys/types.h> /* For size_t. */
#include "libiberty.h"
#include <sys/types.h> /* For size_t. */
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
PTR
xmemdup (input, copy_size, alloc_size)
PTR
xmemdup (input, copy_size, alloc_size)