[syslinux:elflink] elflink: make dprintf() usable in the core

syslinux-bot for H. Peter Anvin hpa at zytor.com
Fri May 18 15:00:07 PDT 2012


Commit-ID:  68e8ee381541fa142e3cda2101255be8b376afe4
Gitweb:     http://www.syslinux.org/commit/68e8ee381541fa142e3cda2101255be8b376afe4
Author:     H. Peter Anvin <hpa at zytor.com>
AuthorDate: Fri, 18 May 2012 14:59:15 -0700
Committer:  H. Peter Anvin <hpa at zytor.com>
CommitDate: Fri, 18 May 2012 14:59:15 -0700

elflink: make dprintf() usable in the core

Make dprintf() usable in the core, as it it on the mainline branch.

Signed-off-by: H. Peter Anvin <hpa at zytor.com>

---
 com32/lib/Makefile   |    8 ++++----
 com32/lib/dprintf.c  |    6 ++++--
 com32/lib/vdprintf.c |    8 +++++---
 3 files changed, 13 insertions(+), 9 deletions(-)

diff --git a/com32/lib/Makefile b/com32/lib/Makefile
index 7bb2d3a..8e6a73a 100644
--- a/com32/lib/Makefile
+++ b/com32/lib/Makefile
@@ -16,7 +16,7 @@ LIBPNG_OBJS = \
 	libpng/pngrio.o libpng/pngwio.o libpng/pngwrite.o		\
 	libpng/pngrtran.o libpng/pngwtran.o libpng/pngmem.o		\
 	libpng/pngerror.o libpng/pngpread.o
-	
+
 # ZIP library object files
 LIBZLIB_OBJS = \
 	zlib/adler32.o zlib/compress.o zlib/crc32.o 			\
@@ -79,6 +79,8 @@ LIBENTRY_OBJS = \
 	sys/openmem.o					\
 	sys/isatty.o sys/fstat.o					\
 	\
+	dprintf.o vdprintf.o						\
+	\
 	syslinux/idle.o							\
 	\
 	exit.o
@@ -93,7 +95,7 @@ LIBGCC_OBJS = \
 	libgcc/__negdi2.o libgcc/__ashrdi3.o libgcc/__lshrdi3.o		\
 	libgcc/__muldi3.o libgcc/__udivmoddi4.o libgcc/__umoddi3.o	\
 	libgcc/__divdi3.o libgcc/__moddi3.o
-	
+
 LIBCONSOLE_OBJS = \
 	\
 	sys/openconsole.o sys/line_input.o				\
@@ -136,8 +138,6 @@ LIBOTHER_OBJS = \
 	\
 	lstrdup.o						\
 	\
-	dprintf.o vdprintf.o						\
-	\
 	suffix_number.o							\
 	\
 	getcwd.o fdopendir.o	\
diff --git a/com32/lib/dprintf.c b/com32/lib/dprintf.c
index 900c0a4..869f07f 100644
--- a/com32/lib/dprintf.c
+++ b/com32/lib/dprintf.c
@@ -5,8 +5,8 @@
 #include <stdio.h>
 #include <stdarg.h>
 
-#undef DEBUG
-#define DEBUG 1
+#ifdef DEBUG
+
 #include <dprintf.h>
 
 void dprintf(const char *format, ...)
@@ -17,3 +17,5 @@ void dprintf(const char *format, ...)
     vdprintf(format, ap);
     va_end(ap);
 }
+
+#endif
diff --git a/com32/lib/vdprintf.c b/com32/lib/vdprintf.c
index 76da012..df04476 100644
--- a/com32/lib/vdprintf.c
+++ b/com32/lib/vdprintf.c
@@ -2,6 +2,8 @@
  * vdprintf.c
  */
 
+#ifdef DEBUG
+
 #include <stdio.h>
 #include <string.h>
 #include <stdarg.h>
@@ -10,8 +12,6 @@
 #include <sys/io.h>
 #include <sys/cpu.h>
 
-#undef DEBUG
-#define DEBUG 1
 #include <dprintf.h>
 
 #define BUFFER_SIZE	4096
@@ -114,5 +114,7 @@ void vdprintf(const char *format, va_list ap)
     while (rv--)
 	debug_putc(*p++);
 
-    _fwrite(buffer, _rv, stdout);
+    /* _fwrite(buffer, _rv, stdout); */
 }
+
+#endif /* DEBUG */


More information about the Syslinux-commits mailing list