summaryrefslogtreecommitdiff
path: root/recipes-graphics/xorg-xserver/xserver-xorg/0001-sdksyms.sh-Make-sdksyms.sh-work-with-gcc5.patch
blob: 215c0441136c6466740d41dcfbf22693c8e40cdb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
Upstream-Status: Pending

From 612eb45a2e7a0b35cc3790870e6d0cc42eb50c74 Mon Sep 17 00:00:00 2001
From: Hans de Goede <hdegoede@redhat.com>
Date: Wed, 11 Feb 2015 16:26:40 +0100
Subject: [PATCH] sdksyms.sh: Make sdksyms.sh work with gcc5.

gcc5's cpp inserts patterns like this:

extern
      __attribute__((visibility("default")))
                int WaitForSomething(int *
    );

This patch make sdksyms.sh work with this. Note my awk skills are weak, so
there likely is a better way to deal with this.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 hw/xfree86/sdksyms.sh | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

Index: xorg-server-1.16.3/hw/xfree86/sdksyms.sh
===================================================================
--- xorg-server-1.16.3.orig/hw/xfree86/sdksyms.sh
+++ xorg-server-1.16.3/hw/xfree86/sdksyms.sh
@@ -353,6 +353,23 @@ BEGIN {
     if (sdk) {
 	n = 3;
 
+	# detect the following gcc5 cpp pattern and skip it:
+	# extern
+	# # 320 "../../include/os.h" 3 4
+	#     __attribute__((visibility("default")))
+	# # 320 "../../include/os.h"
+	# Note in this case the "extern " or "extern void " always has
+	# a trailing space
+	if ($0 ~ "^extern.* $") {
+	    getline;
+	    getline;
+	    getline;
+	    getline;
+	    n = 1;
+	    while ($n == " ")
+		n++;
+	}
+
 	# skip attribute, if any
 	while ($n ~ /^(__attribute__|__global)/ ||
 	    # skip modifiers, if any