From abaff9e0ec9ef4c769edeb7abaf3eee9b86c8d84 Mon Sep 17 00:00:00 2001 From: Bob Friesenhahn Date: Mon, 29 Sep 2003 10:57:57 +0000 Subject: [PATCH] * libltdl/ltdl.c: Only include malloc.h if stdlib.h can not be found. --- ChangeLog | 6 ++++++ libltdl/ltdl.c | 10 ++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) 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 -- 2.47.2