diff --git a/ChangeLog b/ChangeLog index 82d593513..e3c0c64e4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2012-04-30 Riccardo Mottola + + * Source/NSString: + Do not include malloc on OpenBSD to avoid warning (and include stdlib always). + 2012-04-29 Riccardo Mottola * Source/common.h: diff --git a/Source/NSString.m b/Source/NSString.m index a2ab125af..d7bc12fd7 100644 --- a/Source/NSString.m +++ b/Source/NSString.m @@ -1,5 +1,5 @@ /** Implementation of GNUSTEP string class - Copyright (C) 1995, 1996, 1997, 1998 Free Software Foundation, Inc. + Copyright (C) 1995-2012 Free Software Foundation, Inc. Written by: Andrew Kachites McCallum Date: January 1995 @@ -47,6 +47,12 @@ #import "common.h" #include #include + +/* OpenBSD recommends impodring stdlib but not malloc.h for malloc */ +#ifdef HAVE_STDLIB_H +# include +#endif + #import "Foundation/NSAutoreleasePool.h" #import "Foundation/NSCalendarDate.h" #import "Foundation/NSDecimal.h" @@ -89,7 +95,9 @@ #include #ifdef HAVE_MALLOC_H -#include +# ifndef __OpenBSD__ +# include +# endif #endif #ifdef HAVE_ALLOCA_H #include