]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
hashtab.c, [...]: Include string.h if HAVE_STRING_H.
authorZack Weinberg <zack@wolery.cumb.org>
Mon, 29 May 2000 19:33:52 +0000 (19:33 +0000)
committerZack Weinberg <zack@gcc.gnu.org>
Mon, 29 May 2000 19:33:52 +0000 (19:33 +0000)
* 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

libiberty/ChangeLog
libiberty/hashtab.c
libiberty/objalloc.c
libiberty/partition.c
libiberty/pexecute.c
libiberty/sort.c
libiberty/strerror.c
libiberty/strsignal.c
libiberty/xexit.c
libiberty/xmemdup.c

index e61cec3f33397778fccf3336b2b629a7bf0a716c..adeb3c26ec2f68bbdea1416e746b143b411c50e6 100644 (file)
@@ -1,3 +1,15 @@
+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
index f3ee301fd550b43abc1d54d83e18883fe6b27ad6..57b40417c9595ddc9436540403357d09baaf5ad3 100644 (file)
@@ -41,6 +41,10 @@ Boston, MA 02111-1307, USA.  */
 #include <stdlib.h>
 #endif
 
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+
 #include <stdio.h>
 
 #include "libiberty.h"
index 57754a8610524a59bdb56d35805cb1e4be222ce9..50995691e330acb244d72f8eabb8849a97d80eec 100644 (file)
@@ -18,6 +18,8 @@ Foundation, 59 Temple Place - Suite 330,
 Boston, MA 02111-1307, USA.  */
 
 #include "ansidecl.h"
+#include "config.h"
+
 #include "objalloc.h"
 
 /* Get a definition for NULL.  */
@@ -33,11 +35,16 @@ Boston, MA 02111-1307, USA.  */
 #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
 
+#endif
+
 /* These routines allocate space for an object.  Freeing allocated
    space may or may not free all more recently allocated space.
 
index c1d584774bfa2f3047670ca14d7502a65696a62c..52fb128d7bfe9ea887fd9a91af1eaf7a1b5a48e6 100644 (file)
 #include <stdlib.h>
 #endif
 
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+
 #include "libiberty.h"
 #include "partition.h"
 
index 56ddec78dd838908d1a7fc9306e7ea96016198e6..f1aea9db7f0eb625c64a38358ecfea3243dbf5f9 100644 (file)
@@ -35,6 +35,9 @@ Boston, MA 02111-1307, USA.  */
 #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>
index b66a9e1e8567616de93511b8dec042b6c5cb1ef1..da2d660b6f5d743655dc1876a442af38bae46cd9 100644 (file)
@@ -28,6 +28,9 @@ Boston, MA 02111-1307, USA.  */
 #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))
index 644cc75462aee8bcf7d07a6254955060ff0d839b..0dd2220cd73d88840b7e8f003a6484768f10e55e 100644 (file)
 
 /*  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))
index c7bb10c441c46f58e4d598185794b121b18f786b..5625323b71b30ed699849eab41dc9b46b9d82280 100644 (file)
 
 /*  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.  */
index 431bbe02991a011438111ed820efb3ea2d5bb6f4..7aa52ac7599caec0d633116806bb0c0e8a87c2bf 100644 (file)
@@ -21,6 +21,9 @@ Boston, MA 02111-1307, USA.  */
 #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.  */
index f780041aa1330837d66fa1004f5619ca46c60afa..fdb17a547f3a9b1ceeb803f5517c578f15fa71bd 100644 (file)
@@ -9,6 +9,9 @@
 #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)