[syslinux:firmware] core: Rename DEBUG macro to avoid gnu-efi library conflict

syslinux-bot for Chandramouli Narayanan chandramouli.narayanan at intel.com
Fri Nov 9 09:06:26 PST 2012


Commit-ID:  d1e4387577da5a5bc291a112aa51da6f8f1869cc
Gitweb:     http://www.syslinux.org/commit/d1e4387577da5a5bc291a112aa51da6f8f1869cc
Author:     Chandramouli Narayanan <chandramouli.narayanan at intel.com>
AuthorDate: Sat, 1 Sep 2012 07:10:46 -0700
Committer:  Matt Fleming <matt.fleming at intel.com>
CommitDate: Tue, 4 Sep 2012 18:49:39 +0100

core: Rename DEBUG macro to avoid gnu-efi library conflict

Use of DEBUG macro clases with gnu-efi library. This patch defines
CORE_DEBUG. Appropriate changes to sources are made as a result. Also,
the linker error on __bad_SEG is fixed.

Signed-off-by: Chandramouli Narayanan <chandramouli.narayanan at intel.com>
Signed-off-by: Matt Fleming <matt.fleming at intel.com>

---
 com32/include/com32.h   |    2 +-
 com32/include/dprintf.h |    8 ++++----
 core/kaboom.c           |    2 +-
 mk/devel.mk             |    2 +-
 4 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/com32/include/com32.h b/com32/include/com32.h
index 148d08e..7ca187a 100644
--- a/com32/include/com32.h
+++ b/com32/include/com32.h
@@ -135,7 +135,7 @@ char *lstrdup(const char *);
  * specific segment.  OFFS_VALID() will return whether or not the
  * pointer is actually reachable from the target segment.
  */
-#if defined(DEBUG) && (defined(__COM32__) || defined(__SYSLINUX_CORE__))
+#if defined(CORE_DEBUG) && (defined(__COM32__) || defined(__SYSLINUX_CORE__))
 __noreturn __bad_SEG(const volatile void *);
 
 static inline uint16_t SEG(const volatile void *__p)
diff --git a/com32/include/dprintf.h b/com32/include/dprintf.h
index 26ca734..de4625b 100644
--- a/com32/include/dprintf.h
+++ b/com32/include/dprintf.h
@@ -6,10 +6,10 @@
 #define _DPRINTF_H
 
 #if !defined(DEBUG_PORT) && !defined(DEBUG_STDIO)
-# undef DEBUG
+# undef CORE_DEBUG
 #endif
 
-#ifdef DEBUG
+#ifdef CORE_DEBUG
 
 # include <stdio.h>
 
@@ -26,9 +26,9 @@ void vdprintf(const char *, va_list);
 # define dprintf(fmt, ...)	((void)(0))
 # define vdprintf(fmt, ap)	((void)(0))
 
-#endif /* DEBUG */
+#endif /* CORE_DEBUG */
 
-# if DEBUG >= 2
+# if CORE_DEBUG >= 2
 /* Really verbose debugging... */
 #  define dprintf2  dprintf
 #  define vdprintf2 vdprintf
diff --git a/core/kaboom.c b/core/kaboom.c
index 9bb3073..726ca2b 100644
--- a/core/kaboom.c
+++ b/core/kaboom.c
@@ -4,7 +4,7 @@
 
 #include "core.h"
 
-#ifdef DEBUG
+#ifdef CORE_DEBUG
 
 #include <dprintf.h>
 
diff --git a/mk/devel.mk b/mk/devel.mk
index 8184c30..fb4af67 100644
--- a/mk/devel.mk
+++ b/mk/devel.mk
@@ -1,3 +1,3 @@
 # Useful while doing development, but not for production.
 GCCWARN += -Wno-clobbered 
-# GCCWARN += -DDEBUG_PORT=0x3f8 -DDEBUG=1 
+# GCCWARN += -DDEBUG_PORT=0x3f8 -DCORE_DEBUG=1


More information about the Syslinux-commits mailing list