Skip to contentSkip to conversation

xmodmap: fix compile with gcc 4.8

PATCH New Ross Burton 1 participant 1 message Apr 12, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xmodmap: fix compile with gcc 4.8

With gcc 4.8 there are compile errors:

xmodmap.c:289:5: error: implicit declaration of function 'asprintf' [-Werror=implicit-function-declaration] (and more)

These have been fixed upstream so take the patch from git until 1.0.8 is released.

---
 .../xorg-app/xmodmap/gnu-source.patch              |   60 ++++++++++++++++++++
 meta/recipes-graphics/xorg-app/xmodmap_1.0.7.bb    |    2 +
 2 files changed, 62 insertions(+)
 create mode 100644 meta/recipes-graphics/xorg-app/xmodmap/gnu-source.patch
meta/recipes-graphics/xorg-app/xmodmap/gnu-source.patch new file +60 -0
new file mode 100644
index 0000000..84bd973
@@ -0,0 +1,60 @@
+Upstream-Status: Backport
+Signed-off-by: Ross Burton <[email protected]>
+
+From 42f99a7a7b836f6f9704a7b1747eb722c93446ec Mon Sep 17 00:00:00 2001
+From: Alan Coopersmith <[email protected]>
+Date: Mon, 23 Apr 2012 14:28:39 +0000
+Subject: include config.h before stdio.h & other system headers
+
+Ensures definitions like _GNU_SOURCE are visible when needed.
+
+Signed-off-by: Alan Coopersmith <[email protected]>
+Reviewed-by: Peter Hutterer <[email protected]>
+---
+diff --git a/exec.c b/exec.c
+index dbcb669..419b10e 100644
+--- a/exec.c
++++ b/exec.c
+@@ -54,6 +54,10 @@ from The Open Group.
+  * original xmodmap, written by David Rosenthal, of Sun Microsystems.
+  */
+ 
++#ifdef HAVE_CONFIG_H
++# include "config.h"
++#endif
++
+ #include <X11/Xos.h>
+ #include <X11/Xlib.h>
+ #include <stdio.h>
+diff --git a/pf.c b/pf.c
+index 0eb0f55..3f0c3f4 100644
+--- a/pf.c
++++ b/pf.c
+@@ -26,6 +26,10 @@ from The Open Group.
+ 
+ */
+ 
++#ifdef HAVE_CONFIG_H
++# include "config.h"
++#endif
++
+ #include <X11/Xos.h>
+ #include <X11/Xlib.h>
+ #include <stdio.h>
+diff --git a/xmodmap.c b/xmodmap.c
+index 58a8e70..0f89629 100644
+--- a/xmodmap.c
++++ b/xmodmap.c
+@@ -26,6 +26,10 @@ from The Open Group.
+ 
+ */
+ 
++#ifdef HAVE_CONFIG_H
++# include "config.h"
++#endif
++
+ #include <X11/Xos.h>
+ #include <X11/Xlib.h>
+ #include <stdio.h>
+--
+cgit v0.9.0.2-2-gbebe
\ No newline at end of file
meta/recipes-graphics/xorg-app/xmodmap_1.0.7.bb +2 -0
index fab1b16..573eecb 100644
@@ -14,5 +14,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=eef098b27f09d0ac39268df0cc2c00b5"
 PR = "${INC_PR}.0"
 PE = "1"
 
+SRC_URI += "file://gnu-source.patch"
+
 SRC_URI[md5sum] = "d9b65f6881afe0d6d9863b30e1081bde"
 SRC_URI[sha256sum] = "ef22ede9c4a3c720da539292c6911515a8408e618e0dec6aa2196ee2153de4b5"
Signature · 1 line
1.7.10.4