[PATCH 3/5] Fix gcc warnings about redundant declarations of fallback functions

Alan Coopersmith alan.coopersmith at oracle.com
Fri Dec 2 10:48:14 PST 2011


Ensure ffs, strndup, strlcat, etc. aren't defined by our headers
if they're already defined in the system headers.

Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>
---
 hw/xfree86/xaa/xaaTables.c |    3 +++
 include/dix.h              |    2 ++
 include/xorg-server.h.in   |   21 +++++++++++++++++++++
 3 files changed, 26 insertions(+), 0 deletions(-)

diff --git a/hw/xfree86/xaa/xaaTables.c b/hw/xfree86/xaa/xaaTables.c
index c7fa28a..dbeb4a2 100644
--- a/hw/xfree86/xaa/xaaTables.c
+++ b/hw/xfree86/xaa/xaaTables.c
@@ -1,3 +1,6 @@
+#ifdef HAVE_XORG_CONFIG_H
+#include <xorg-config.h>
+#endif
 #include "xaalocal.h"
 /*
  * This is a table of 24-bit values, indexed with an 8-bit byte value, then
diff --git a/include/dix.h b/include/dix.h
index 34661f3..f98c87b 100644
--- a/include/dix.h
+++ b/include/dix.h
@@ -529,7 +529,9 @@ extern _X_EXPORT void
 ScreenRestructured (ScreenPtr pScreen);
 #endif
 
+#ifndef HAVE_FFS
 extern _X_EXPORT int ffs(int i);
+#endif
 
 
 /*
diff --git a/include/xorg-server.h.in b/include/xorg-server.h.in
index b10b994..8086f32 100644
--- a/include/xorg-server.h.in
+++ b/include/xorg-server.h.in
@@ -37,6 +37,27 @@
 /* Support SHM */
 #undef HAS_SHM
 
+/* Define to 1 if you have the `ffs' function. */
+#undef HAVE_FFS
+
+/* Define to 1 if you have the `strcasecmp' function. */
+#undef HAVE_STRCASECMP
+
+/* Define to 1 if you have the `strcasestr' function. */
+#undef HAVE_STRCASESTR
+
+/* Define to 1 if you have the `strlcat' function. */
+#undef HAVE_STRLCAT
+
+/* Define to 1 if you have the `strlcpy' function. */
+#undef HAVE_STRLCPY
+
+/* Define to 1 if you have the `strncasecmp' function. */
+#undef HAVE_STRNCASECMP
+
+/* Define to 1 if you have the `strndup' function. */
+#undef HAVE_STRNDUP
+
 /* Support IPv6 for TCP connections */
 #undef IPv6
 
-- 
1.7.3.2



More information about the xorg-devel mailing list