From: Bob Friesenhahn Date: Mon, 29 Sep 2003 10:57:57 +0000 (+0000) Subject: * libltdl/ltdl.c: Only include malloc.h if stdlib.h can not be X-Git-Tag: release-1-9b~319 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=abaff9e0ec9ef4c769edeb7abaf3eee9b86c8d84;p=thirdparty%2Flibtool.git * libltdl/ltdl.c: Only include malloc.h if stdlib.h can not be found. --- diff --git a/ChangeLog b/ChangeLog index 0c897b6cd..fe113c92f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2003-09-29 Bob Friesenhahn , + Dalibor Topic + + * libltdl/ltdl.c: Only include malloc.h if stdlib.h can not be + found. + 2003-09-26 Alfred M. Szmidt * mdemo2/Makefile.am (INCLUDES): Include `$(top_srcdir)/../libltdl' instead of `../libltdl'. diff --git a/libltdl/ltdl.c b/libltdl/ltdl.c index 7fbb4a495..ce8108430 100644 --- a/libltdl/ltdl.c +++ b/libltdl/ltdl.c @@ -37,8 +37,14 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA # include #endif +/* Include the header defining malloc. On K&R C compilers, + that's , on ANSI C and ISO C compilers, that's . */ #if HAVE_STDLIB_H # include +#else +# if HAVE_MALLOC_H +# include +# endif #endif #if HAVE_STRING_H @@ -53,10 +59,6 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA # include #endif -#if HAVE_MALLOC_H -# include -#endif - #if HAVE_MEMORY_H # include #endif