From: borutr Date: Tue, 4 Nov 2003 13:47:38 +0000 (+0000) Subject: * configure, configure.in, sdcc_vc_in.h, sdcconf.h, X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=3496b9c93e952c27e5310e3804f9dcbf9c3795ee;p=fw%2Fsdcc * configure, configure.in, sdcc_vc_in.h, sdcconf.h, support/Util/NewAlloc.c, as/hc08/lklibr.c, as/mcs51/lklibr.c, as/z80/aslist.c, as/z80/assym.c: decision to include malloc.h transferred to configure git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@2991 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- diff --git a/ChangeLog b/ChangeLog index c2fd9c5e..64a345eb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2003-11-04 Borut Razem + + * configure, configure.in, sdcc_vc_in.h, sdcconf.h, + support/Util/NewAlloc.c, as/hc08/lklibr.c, as/mcs51/lklibr.c, + as/z80/aslist.c, as/z80/assym.c: decision to include malloc.h + transferred to configure + 2003-11-03 Bernhard Held Use headers defined in the C[++] standards: diff --git a/as/hc08/lklibr.c b/as/hc08/lklibr.c index 3982e03e..2481d9f0 100644 --- a/as/hc08/lklibr.c +++ b/as/hc08/lklibr.c @@ -21,9 +21,11 @@ #if defined(__APPLE__) && defined(__MACH__) #include #include -#elseif !defined(__FreeBSD__) +#else +#ifdef HAVE_MALLOC_H #include #endif +#endif #include #include #include diff --git a/as/mcs51/lklibr.c b/as/mcs51/lklibr.c index 808dfc64..2e9bfe43 100644 --- a/as/mcs51/lklibr.c +++ b/as/mcs51/lklibr.c @@ -21,9 +21,11 @@ #if defined(__APPLE__) && defined(__MACH__) #include #include -#elseif !defined(__FreeBSD__) +#else +#ifdef HAVE_MALLOC_H #include #endif +#endif #include #include #include diff --git a/as/z80/aslist.c b/as/z80/aslist.c index 3a7d0a7f..997bb4c9 100644 --- a/as/z80/aslist.c +++ b/as/z80/aslist.c @@ -21,8 +21,10 @@ #include #include #else +#ifdef HAVE_MALLOC_H #include #endif +#endif #include "asm.h" diff --git a/as/z80/assym.c b/as/z80/assym.c index dadce441..3a9ac0a4 100644 --- a/as/z80/assym.c +++ b/as/z80/assym.c @@ -17,8 +17,10 @@ #include #include #else +#ifdef HAVE_MALLOC_H #include #endif +#endif #include "asm.h" /*)Module assym.c diff --git a/configure b/configure index ee771bed..1f6392b5 100755 --- a/configure +++ b/configure @@ -3893,7 +3893,8 @@ done -for ac_header in sys/socket.h + +for ac_header in sys/socket.h malloc.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then diff --git a/configure.in b/configure.in index e1172242..c7ca5c5f 100755 --- a/configure.in +++ b/configure.in @@ -69,7 +69,7 @@ AC_LANG([C]) # Checking for header files. # =========================================================================== -AC_CHECK_HEADERS(sys/socket.h) +AC_CHECK_HEADERS(sys/socket.h malloc.h) # Checking for functions diff --git a/sdcc_vc_in.h b/sdcc_vc_in.h index 4c482f6f..840ffe9b 100644 --- a/sdcc_vc_in.h +++ b/sdcc_vc_in.h @@ -39,9 +39,10 @@ #define STD_FP_LIB "libfloat" #define STD_DS390_LIB "libds390" #define STD_DS400_LIB "libds400" -// #undef STD_XA51_LIB +/* #undef STD_XA51_LIB */ -// #undef HAVE_SYS_SOCKET_H +/* #undef HAVE_SYS_SOCKET_H */ +#define HAVE_MALLOC_H #undef HAVE_STRERROR #define HAVE_VSNPRINTF diff --git a/sdccconf_in.h b/sdccconf_in.h index aa501882..a7221d87 100644 --- a/sdccconf_in.h +++ b/sdccconf_in.h @@ -40,6 +40,7 @@ #undef STD_XA51_LIB #undef HAVE_SYS_SOCKET_H +#undef HAVE_MALLOC_H #undef HAVE_STRERROR #undef HAVE_VSNPRINTF diff --git a/support/Util/NewAlloc.c b/support/Util/NewAlloc.c index 264311bb..86e78e43 100644 --- a/support/Util/NewAlloc.c +++ b/support/Util/NewAlloc.c @@ -30,9 +30,11 @@ functions. #include #if defined(__APPLE__) && defined(__MACH__) #include -#elseif !defined(__FreeBSD__) +#else +#ifdef HAVE_MALLOC_H #include #endif +#endif #include #include #include @@ -48,7 +50,7 @@ functions. allocated with malloc() then the program will segfault. Might as well drop it and let the garbase collector take care of things. */ -#define FREE(_a) +#define FREE(_a) #else