]> granicus.if.org Git - yasm/commitdiff
Add option for malloc debugging using dmalloc library (http://dmalloc.com/).
authorPeter Johnson <peter@tortall.net>
Mon, 29 Oct 2001 00:01:31 +0000 (00:01 -0000)
committerPeter Johnson <peter@tortall.net>
Mon, 29 Oct 2001 00:01:31 +0000 (00:01 -0000)
Remove unnecessary stdlib includes (because we use xmalloc instead of malloc).

svn path=/trunk/yasm/; revision=297

43 files changed:
configure.ac
configure.in
frontends/yasm/yasm.c
libyasm/bitvect.c
libyasm/bytecode.c
libyasm/errwarn.c
libyasm/expr.c
libyasm/floatnum.c
libyasm/intnum.c
libyasm/mergesort.c
libyasm/section.c
libyasm/symrec.c
libyasm/xmalloc.c
libyasm/xstrdup.c
mergesort.c
modules/arch/x86/expr.c
modules/arch/x86/x86expr.c
modules/parsers/nasm/bison.y.in
modules/parsers/nasm/nasm-bison.y
modules/parsers/nasm/nasm-parser.c
modules/parsers/nasm/parser.c
modules/parsers/nasm/token.l.in
src/arch/x86/expr.c
src/arch/x86/x86expr.c
src/bitvect.c
src/bytecode.c
src/errwarn.c
src/expr.c
src/floatnum.c
src/intnum.c
src/main.c
src/mergesort.c
src/parser.c
src/parsers/nasm/bison.y.in
src/parsers/nasm/nasm-bison.y
src/parsers/nasm/nasm-parser.c
src/parsers/nasm/parser.c
src/parsers/nasm/token.l.in
src/section.c
src/symrec.c
src/ternary.c
src/xmalloc.c
src/xstrdup.c

index d2d19677cf7b35fc25b963a176140b09408f60c9..b6d59fbdf626fa15a90f26b55fced8ebdade97ef 100644 (file)
@@ -41,6 +41,14 @@ AC_ARG_ENABLE(profiling,
   *) AC_MSG_ERROR(bad value ${enableval} for --enable-profiling) ;;
 esac],[profiling=false])
 
+AC_ARG_ENABLE(dmalloc,
+[  --enable-dmalloc    Enable debug malloc (requires dmalloc library)],
+[case "${enableval}" in
+  yes) dmalloc=true ;;
+  no)  dmalloc=false ;;
+  *) AC_MSG_ERROR(bad value ${enableval} for --enable-dmalloc) ;;
+esac],[dmalloc=false])
+
 AC_ARG_ENABLE(check,
 [  --disable-check     Disable building of test suite and make check],
 [case "${enableval}" in
@@ -53,23 +61,36 @@ AM_CONDITIONAL(CHECK, test x$check = xtrue)
 AM_PROG_CC_STDC
 
 if ${dev}; then
-       DEVFLAGS="-g"
+       DEVFLAGS=" -g"
 fi
 
 if ${morewarn}; then
-       MOREWARNFLAGS="-Wbad-function-cast -Wcast-align -Wcast-qual -Wchar-subscripts -Winline -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wredundant-decls -Wshadow -Wstrict-prototypes -Wwrite-strings"
+       MOREWARNFLAGS=" -Wbad-function-cast -Wcast-align -Wcast-qual -Wchar-subscripts -Winline -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings"
 fi
 
 if ${warnerror}; then
-       WARNERRORFLAGS="-Werror"
+       WARNERRORFLAGS=" -Werror"
 fi
 
 if ${profiling}; then
-       PROFILINGFLAGS="-pg"
+       PROFILINGFLAGS=" -pg"
+fi
+
+if ${dmalloc}; then
+       AC_CHECK_HEADERS(dmalloc.h)
+       AC_CHECK_LIB(dmalloc, main)
+       if test "$ac_cv_header_dmalloc_h" != yes ||
+          test "$ac_cv_lib_dmalloc_main" != yes; then
+           AC_MSG_ERROR([dmalloc required for --enable-dmalloc.])
+       else
+           DMALLOCFLAGS=" -DDMALLOC"
+       fi
+else
+    DMALLOCFLAGS=" -Wredundant-decls"
 fi
 
 if test "$GCC" = yes; then
-       ANSI_CFLAGS="-ansi -pedantic -Wall $MOREWARNFLAGS $WARNERRORFLAGS $DEVFLAGS $PROFILINGFLAGS"
+       ANSI_CFLAGS="-ansi -pedantic -Wall$MOREWARNFLAGS$WARNERRORFLAGS$DEVFLAGS$PROFILINGFLAGS$DMALLOCFLAGS"
 else
        ANSI_CFLAGS="$DEVFLAGS"
 fi
index d2d19677cf7b35fc25b963a176140b09408f60c9..b6d59fbdf626fa15a90f26b55fced8ebdade97ef 100644 (file)
@@ -41,6 +41,14 @@ AC_ARG_ENABLE(profiling,
   *) AC_MSG_ERROR(bad value ${enableval} for --enable-profiling) ;;
 esac],[profiling=false])
 
+AC_ARG_ENABLE(dmalloc,
+[  --enable-dmalloc    Enable debug malloc (requires dmalloc library)],
+[case "${enableval}" in
+  yes) dmalloc=true ;;
+  no)  dmalloc=false ;;
+  *) AC_MSG_ERROR(bad value ${enableval} for --enable-dmalloc) ;;
+esac],[dmalloc=false])
+
 AC_ARG_ENABLE(check,
 [  --disable-check     Disable building of test suite and make check],
 [case "${enableval}" in
@@ -53,23 +61,36 @@ AM_CONDITIONAL(CHECK, test x$check = xtrue)
 AM_PROG_CC_STDC
 
 if ${dev}; then
-       DEVFLAGS="-g"
+       DEVFLAGS=" -g"
 fi
 
 if ${morewarn}; then
-       MOREWARNFLAGS="-Wbad-function-cast -Wcast-align -Wcast-qual -Wchar-subscripts -Winline -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wredundant-decls -Wshadow -Wstrict-prototypes -Wwrite-strings"
+       MOREWARNFLAGS=" -Wbad-function-cast -Wcast-align -Wcast-qual -Wchar-subscripts -Winline -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings"
 fi
 
 if ${warnerror}; then
-       WARNERRORFLAGS="-Werror"
+       WARNERRORFLAGS=" -Werror"
 fi
 
 if ${profiling}; then
-       PROFILINGFLAGS="-pg"
+       PROFILINGFLAGS=" -pg"
+fi
+
+if ${dmalloc}; then
+       AC_CHECK_HEADERS(dmalloc.h)
+       AC_CHECK_LIB(dmalloc, main)
+       if test "$ac_cv_header_dmalloc_h" != yes ||
+          test "$ac_cv_lib_dmalloc_main" != yes; then
+           AC_MSG_ERROR([dmalloc required for --enable-dmalloc.])
+       else
+           DMALLOCFLAGS=" -DDMALLOC"
+       fi
+else
+    DMALLOCFLAGS=" -Wredundant-decls"
 fi
 
 if test "$GCC" = yes; then
-       ANSI_CFLAGS="-ansi -pedantic -Wall $MOREWARNFLAGS $WARNERRORFLAGS $DEVFLAGS $PROFILINGFLAGS"
+       ANSI_CFLAGS="-ansi -pedantic -Wall$MOREWARNFLAGS$WARNERRORFLAGS$DEVFLAGS$PROFILINGFLAGS$DMALLOCFLAGS"
 else
        ANSI_CFLAGS="$DEVFLAGS"
 fi
index edd8f3ed4590423c5e9564e5415ccc8fc09f04f6..6a93e7bc84e446d132713aaaa4f796fe1e15d16c 100644 (file)
 #include "preproc.h"
 #include "parser.h"
 
+#ifdef DMALLOC
+# include <dmalloc.h>
+#endif
+
 RCSID("$IdPath$");
 
 #ifndef countof
index 34b3a94c4e45789e376732c821394bad0a13c855..20de3bb6246d281cb0dafdfd6a4cdd3cca5e3efb 100644 (file)
@@ -11,7 +11,6 @@
 /*  MODULE IMPORTS:                                                          */
 /*****************************************************************************/
 #ifdef STDC_HEADERS
-#include <stdlib.h>                                 /*  MODULE TYPE:  (sys)  */
 #include <limits.h>                                 /*  MODULE TYPE:  (sys)  */
 #include <string.h>                                 /*  MODULE TYPE:  (sys)  */
 #include <ctype.h>                                  /*  MODULE TYPE:  (sys)  */
 /*****************************************************************************/
 #include "bitvect.h"
 
+#ifdef DMALLOC
+# include <dmalloc.h>
+#endif
+
 RCSID("$IdPath$");
 
 /* ToolBox.h */
index ee8125abd20aa54a7df8b9e038428df6d0873f81..24867681c76e255d6fa3b86ec2d2f375f6df91b6 100644 (file)
@@ -28,7 +28,6 @@
 #include <stdio.h>
 
 #ifdef STDC_HEADERS
-# include <stdlib.h>
 # include <string.h>
 #endif
 
 #include "bytecode.h"
 #include "section.h"
 
+#ifdef DMALLOC
+# include <dmalloc.h>
+#endif
+
 RCSID("$IdPath$");
 
 struct effaddr {
index 18091ee4f32bfe1d6e70b6e5a63b29376514ef50..05760ed7b4d6c4ccff3f3a4f3177887eeba5fdf2 100644 (file)
 #include "globals.h"
 #include "errwarn.h"
 
+#ifdef DMALLOC
+# include <dmalloc.h>
+#endif
+
 RCSID("$IdPath$");
 
 /* Total error count for entire assembler run.
index dc86213533f5bc3b197bab42449653523619c46a..2f1b507ab5a806f3f24a2b574ba529521d64b9f7 100644 (file)
 #include "expr.h"
 #include "symrec.h"
 
+#ifdef DMALLOC
+# include <dmalloc.h>
+#endif
+
 RCSID("$IdPath$");
 
 /* Types listed in canonical sorting order.  See expr_order_terms(). */
index 2c1075f18360e538aed46e9fcdce71a4be021dd7..1329a5b36d2fb886cf223d022e485d0f42f1b396 100644 (file)
@@ -31,7 +31,6 @@
 #include <ctype.h>
 
 #ifdef STDC_HEADERS
-# include <stdlib.h>
 # include <string.h>
 #endif
 
 #include "errwarn.h"
 #include "floatnum.h"
 
+#ifdef DMALLOC
+# include <dmalloc.h>
+#endif
+
 RCSID("$IdPath$");
 
 /* 97-bit internal floating point format:
index 1d6c9fb46acbfcc068f3a2ca4a0b561986af38bb..05be9b5c2cf2551b402c44b0936e07fe40183217 100644 (file)
@@ -29,7 +29,6 @@
 #include <ctype.h>
 
 #ifdef STDC_HEADERS
-# include <stdlib.h>
 # include <string.h>
 #endif
 
 #include "errwarn.h"
 #include "intnum.h"
 
+#ifdef DMALLOC
+# include <dmalloc.h>
+#endif
+
 RCSID("$IdPath$");
 
 #define BITVECT_ALLOC_SIZE     80
index 89d7123541d65414c67e1715fe0d2e94d9bab802..21de4f71c151f0516859d7c8ee9ed4ef4b896ca0 100644 (file)
 
 #include "util.h"
 
+#ifdef DMALLOC
+# include <dmalloc.h>
+#endif
+
 RCSID("$IdPath$");
 
 #if defined(LIBC_SCCS) && !defined(lint)
@@ -60,7 +64,6 @@ static char sccsid[] = "@(#)merge.c   8.2 (Berkeley) 2/14/94";
 
 #ifdef STDC_HEADERS
 # include <errno.h>
-# include <stdlib.h>
 # include <string.h>
 #endif
 
index 2b90ec530ba23eff01c4ffec98d5009f64954ba0..52d62a2df3ceef55bec4e80f2723c8946d28ca42 100644 (file)
@@ -28,7 +28,6 @@
 #include <stdio.h>
 
 #ifdef STDC_HEADERS
-# include <stdlib.h>
 # include <string.h>
 #endif
 
 #include "section.h"
 #include "objfmt.h"
 
+#ifdef DMALLOC
+# include <dmalloc.h>
+#endif
+
 RCSID("$IdPath$");
 
 struct section {
index 46db876e44fd806eb7fd503502011acb3f20b813..411278e682f2f41da46b2f10dd853a6073fdc6af 100644 (file)
@@ -28,7 +28,6 @@
 #include <stdio.h>
 
 #ifdef STDC_HEADERS
-# include <stdlib.h>
 # include <string.h>
 #endif
 
 #include "bytecode.h"
 #include "section.h"
 
+#ifdef DMALLOC
+# include <dmalloc.h>
+#endif
+
 RCSID("$IdPath$");
 
 /* DEFINED is set with EXTERN and COMMON below */
index 9a3cd35156f53f6b2fa93c93906b0ae32aad4faa..baca251536880c5b8a72a25c6fb20798b1b4c66d 100644 (file)
@@ -31,6 +31,8 @@
 
 #include "errwarn.h"
 
+#ifndef DMALLOC
+
 RCSID("$IdPath$");
 
 void *
@@ -78,3 +80,4 @@ xrealloc(void *oldmem, size_t size)
 
     return newmem;
 }
+#endif
index 2efc8c8b444c52f08fd02b7fbdba6f0eede405e2..c0b3027221ec3c82b3b140d2214eeec068f0d09c 100644 (file)
@@ -41,7 +41,6 @@ static char sccsid[] = "@(#)strdup.c  8.1 (Berkeley) 6/4/93";
 
 #ifdef STDC_HEADERS
 # include <stddef.h>
-# include <stdlib.h>
 # include <string.h>
 #else
 size_t strlen(const char *);
@@ -53,6 +52,8 @@ void memcpy(void *, const void *, size_t);
 # endif
 #endif
 
+#ifndef DMALLOC
+
 RCSID("$IdPath$");
 
 char *
@@ -66,3 +67,4 @@ xstrdup(const char *str)
        memcpy(copy, str, len);
        return (copy);
 }
+#endif
index 89d7123541d65414c67e1715fe0d2e94d9bab802..21de4f71c151f0516859d7c8ee9ed4ef4b896ca0 100644 (file)
 
 #include "util.h"
 
+#ifdef DMALLOC
+# include <dmalloc.h>
+#endif
+
 RCSID("$IdPath$");
 
 #if defined(LIBC_SCCS) && !defined(lint)
@@ -60,7 +64,6 @@ static char sccsid[] = "@(#)merge.c   8.2 (Berkeley) 2/14/94";
 
 #ifdef STDC_HEADERS
 # include <errno.h>
-# include <stdlib.h>
 # include <string.h>
 #endif
 
index dc86213533f5bc3b197bab42449653523619c46a..2f1b507ab5a806f3f24a2b574ba529521d64b9f7 100644 (file)
 #include "expr.h"
 #include "symrec.h"
 
+#ifdef DMALLOC
+# include <dmalloc.h>
+#endif
+
 RCSID("$IdPath$");
 
 /* Types listed in canonical sorting order.  See expr_order_terms(). */
index dc86213533f5bc3b197bab42449653523619c46a..2f1b507ab5a806f3f24a2b574ba529521d64b9f7 100644 (file)
 #include "expr.h"
 #include "symrec.h"
 
+#ifdef DMALLOC
+# include <dmalloc.h>
+#endif
+
 RCSID("$IdPath$");
 
 /* Types listed in canonical sorting order.  See expr_order_terms(). */
index 8da12974aa10b0f762e2a5df88d7e7db1c61348f..234e6784c51fd3bf3de8f09c8ceb865ac51eb82f 100644 (file)
 #include "section.h"
 #include "objfmt.h"
 
+#ifdef DMALLOC
+# include <dmalloc.h>
+#endif
+
 RCSID("$IdPath$");
 
 #define YYDEBUG 1
index 8da12974aa10b0f762e2a5df88d7e7db1c61348f..234e6784c51fd3bf3de8f09c8ceb865ac51eb82f 100644 (file)
 #include "section.h"
 #include "objfmt.h"
 
+#ifdef DMALLOC
+# include <dmalloc.h>
+#endif
+
 RCSID("$IdPath$");
 
 #define YYDEBUG 1
index 2f43d0c425e6c612025e5d9402158aac8d415d2a..a4d9a519baa7d4a8912d508575abca58fdab8ee9 100644 (file)
 
 #include <stdio.h>
 
-#ifdef STDC_HEADERS
-# include <stdlib.h>
-#endif
-
 #include "errwarn.h"
 
 #include "bytecode.h"
index 2f43d0c425e6c612025e5d9402158aac8d415d2a..a4d9a519baa7d4a8912d508575abca58fdab8ee9 100644 (file)
 
 #include <stdio.h>
 
-#ifdef STDC_HEADERS
-# include <stdlib.h>
-#endif
-
 #include "errwarn.h"
 
 #include "bytecode.h"
index d5dc46afc18c1332916ebc170bf9ea8ce42488dc..6973afbe3e2cd0bf1e81c9d4350fc5a0954c1915 100644 (file)
 
 #include "bison.h"
 
+#ifdef DMALLOC
+# include <dmalloc.h>
+#endif
+
 RCSID("$IdPath$");
 
 #define YY_NEVER_INTERACTIVE   1
index dc86213533f5bc3b197bab42449653523619c46a..2f1b507ab5a806f3f24a2b574ba529521d64b9f7 100644 (file)
 #include "expr.h"
 #include "symrec.h"
 
+#ifdef DMALLOC
+# include <dmalloc.h>
+#endif
+
 RCSID("$IdPath$");
 
 /* Types listed in canonical sorting order.  See expr_order_terms(). */
index dc86213533f5bc3b197bab42449653523619c46a..2f1b507ab5a806f3f24a2b574ba529521d64b9f7 100644 (file)
 #include "expr.h"
 #include "symrec.h"
 
+#ifdef DMALLOC
+# include <dmalloc.h>
+#endif
+
 RCSID("$IdPath$");
 
 /* Types listed in canonical sorting order.  See expr_order_terms(). */
index 34b3a94c4e45789e376732c821394bad0a13c855..20de3bb6246d281cb0dafdfd6a4cdd3cca5e3efb 100644 (file)
@@ -11,7 +11,6 @@
 /*  MODULE IMPORTS:                                                          */
 /*****************************************************************************/
 #ifdef STDC_HEADERS
-#include <stdlib.h>                                 /*  MODULE TYPE:  (sys)  */
 #include <limits.h>                                 /*  MODULE TYPE:  (sys)  */
 #include <string.h>                                 /*  MODULE TYPE:  (sys)  */
 #include <ctype.h>                                  /*  MODULE TYPE:  (sys)  */
 /*****************************************************************************/
 #include "bitvect.h"
 
+#ifdef DMALLOC
+# include <dmalloc.h>
+#endif
+
 RCSID("$IdPath$");
 
 /* ToolBox.h */
index ee8125abd20aa54a7df8b9e038428df6d0873f81..24867681c76e255d6fa3b86ec2d2f375f6df91b6 100644 (file)
@@ -28,7 +28,6 @@
 #include <stdio.h>
 
 #ifdef STDC_HEADERS
-# include <stdlib.h>
 # include <string.h>
 #endif
 
 #include "bytecode.h"
 #include "section.h"
 
+#ifdef DMALLOC
+# include <dmalloc.h>
+#endif
+
 RCSID("$IdPath$");
 
 struct effaddr {
index 18091ee4f32bfe1d6e70b6e5a63b29376514ef50..05760ed7b4d6c4ccff3f3a4f3177887eeba5fdf2 100644 (file)
 #include "globals.h"
 #include "errwarn.h"
 
+#ifdef DMALLOC
+# include <dmalloc.h>
+#endif
+
 RCSID("$IdPath$");
 
 /* Total error count for entire assembler run.
index dc86213533f5bc3b197bab42449653523619c46a..2f1b507ab5a806f3f24a2b574ba529521d64b9f7 100644 (file)
 #include "expr.h"
 #include "symrec.h"
 
+#ifdef DMALLOC
+# include <dmalloc.h>
+#endif
+
 RCSID("$IdPath$");
 
 /* Types listed in canonical sorting order.  See expr_order_terms(). */
index 2c1075f18360e538aed46e9fcdce71a4be021dd7..1329a5b36d2fb886cf223d022e485d0f42f1b396 100644 (file)
@@ -31,7 +31,6 @@
 #include <ctype.h>
 
 #ifdef STDC_HEADERS
-# include <stdlib.h>
 # include <string.h>
 #endif
 
 #include "errwarn.h"
 #include "floatnum.h"
 
+#ifdef DMALLOC
+# include <dmalloc.h>
+#endif
+
 RCSID("$IdPath$");
 
 /* 97-bit internal floating point format:
index 1d6c9fb46acbfcc068f3a2ca4a0b561986af38bb..05be9b5c2cf2551b402c44b0936e07fe40183217 100644 (file)
@@ -29,7 +29,6 @@
 #include <ctype.h>
 
 #ifdef STDC_HEADERS
-# include <stdlib.h>
 # include <string.h>
 #endif
 
 #include "errwarn.h"
 #include "intnum.h"
 
+#ifdef DMALLOC
+# include <dmalloc.h>
+#endif
+
 RCSID("$IdPath$");
 
 #define BITVECT_ALLOC_SIZE     80
index edd8f3ed4590423c5e9564e5415ccc8fc09f04f6..6a93e7bc84e446d132713aaaa4f796fe1e15d16c 100644 (file)
 #include "preproc.h"
 #include "parser.h"
 
+#ifdef DMALLOC
+# include <dmalloc.h>
+#endif
+
 RCSID("$IdPath$");
 
 #ifndef countof
index 89d7123541d65414c67e1715fe0d2e94d9bab802..21de4f71c151f0516859d7c8ee9ed4ef4b896ca0 100644 (file)
 
 #include "util.h"
 
+#ifdef DMALLOC
+# include <dmalloc.h>
+#endif
+
 RCSID("$IdPath$");
 
 #if defined(LIBC_SCCS) && !defined(lint)
@@ -60,7 +64,6 @@ static char sccsid[] = "@(#)merge.c   8.2 (Berkeley) 2/14/94";
 
 #ifdef STDC_HEADERS
 # include <errno.h>
-# include <stdlib.h>
 # include <string.h>
 #endif
 
index c6bc72fff978afca152d4064097b3d86ced77385..3b7d360e2a4517f909397546893d4e03f3f28d38 100644 (file)
@@ -28,7 +28,6 @@
 #include <stdio.h>
 
 #ifdef STDC_HEADERS
-# include <stdlib.h>
 # include <string.h>
 #endif
 
 #include "preproc.h"
 #include "parser.h"
 
+#ifdef DMALLOC
+# include <dmalloc.h>
+#endif
+
 RCSID("$IdPath$");
 
 /* NULL-terminated list of all available parsers.
index 8da12974aa10b0f762e2a5df88d7e7db1c61348f..234e6784c51fd3bf3de8f09c8ceb865ac51eb82f 100644 (file)
 #include "section.h"
 #include "objfmt.h"
 
+#ifdef DMALLOC
+# include <dmalloc.h>
+#endif
+
 RCSID("$IdPath$");
 
 #define YYDEBUG 1
index 8da12974aa10b0f762e2a5df88d7e7db1c61348f..234e6784c51fd3bf3de8f09c8ceb865ac51eb82f 100644 (file)
 #include "section.h"
 #include "objfmt.h"
 
+#ifdef DMALLOC
+# include <dmalloc.h>
+#endif
+
 RCSID("$IdPath$");
 
 #define YYDEBUG 1
index 2f43d0c425e6c612025e5d9402158aac8d415d2a..a4d9a519baa7d4a8912d508575abca58fdab8ee9 100644 (file)
 
 #include <stdio.h>
 
-#ifdef STDC_HEADERS
-# include <stdlib.h>
-#endif
-
 #include "errwarn.h"
 
 #include "bytecode.h"
index 2f43d0c425e6c612025e5d9402158aac8d415d2a..a4d9a519baa7d4a8912d508575abca58fdab8ee9 100644 (file)
 
 #include <stdio.h>
 
-#ifdef STDC_HEADERS
-# include <stdlib.h>
-#endif
-
 #include "errwarn.h"
 
 #include "bytecode.h"
index d5dc46afc18c1332916ebc170bf9ea8ce42488dc..6973afbe3e2cd0bf1e81c9d4350fc5a0954c1915 100644 (file)
 
 #include "bison.h"
 
+#ifdef DMALLOC
+# include <dmalloc.h>
+#endif
+
 RCSID("$IdPath$");
 
 #define YY_NEVER_INTERACTIVE   1
index 2b90ec530ba23eff01c4ffec98d5009f64954ba0..52d62a2df3ceef55bec4e80f2723c8946d28ca42 100644 (file)
@@ -28,7 +28,6 @@
 #include <stdio.h>
 
 #ifdef STDC_HEADERS
-# include <stdlib.h>
 # include <string.h>
 #endif
 
 #include "section.h"
 #include "objfmt.h"
 
+#ifdef DMALLOC
+# include <dmalloc.h>
+#endif
+
 RCSID("$IdPath$");
 
 struct section {
index 46db876e44fd806eb7fd503502011acb3f20b813..411278e682f2f41da46b2f10dd853a6073fdc6af 100644 (file)
@@ -28,7 +28,6 @@
 #include <stdio.h>
 
 #ifdef STDC_HEADERS
-# include <stdlib.h>
 # include <string.h>
 #endif
 
 #include "bytecode.h"
 #include "section.h"
 
+#ifdef DMALLOC
+# include <dmalloc.h>
+#endif
+
 RCSID("$IdPath$");
 
 /* DEFINED is set with EXTERN and COMMON below */
index 7b7b920f3dfb7a6432c70a36799480f7e17ecfe9..04f8b2e0a92fccce87c9fe8f16d821f5c202b48d 100644 (file)
 
 #include <stdio.h>
 
-#ifdef STDC_HEADERS
-#include <stdlib.h>
-#endif
-
 #include "errwarn.h"
 
 #include "ternary.h"
 
+#ifdef DMALLOC
+# include <dmalloc.h>
+#endif
+
 RCSID("$IdPath$");
 
 /* Non-recursive so we don't waste stack space/time on large
index 9a3cd35156f53f6b2fa93c93906b0ae32aad4faa..baca251536880c5b8a72a25c6fb20798b1b4c66d 100644 (file)
@@ -31,6 +31,8 @@
 
 #include "errwarn.h"
 
+#ifndef DMALLOC
+
 RCSID("$IdPath$");
 
 void *
@@ -78,3 +80,4 @@ xrealloc(void *oldmem, size_t size)
 
     return newmem;
 }
+#endif
index 2efc8c8b444c52f08fd02b7fbdba6f0eede405e2..c0b3027221ec3c82b3b140d2214eeec068f0d09c 100644 (file)
@@ -41,7 +41,6 @@ static char sccsid[] = "@(#)strdup.c  8.1 (Berkeley) 6/4/93";
 
 #ifdef STDC_HEADERS
 # include <stddef.h>
-# include <stdlib.h>
 # include <string.h>
 #else
 size_t strlen(const char *);
@@ -53,6 +52,8 @@ void memcpy(void *, const void *, size_t);
 # endif
 #endif
 
+#ifndef DMALLOC
+
 RCSID("$IdPath$");
 
 char *
@@ -66,3 +67,4 @@ xstrdup(const char *str)
        memcpy(copy, str, len);
        return (copy);
 }
+#endif