aboutsummaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-extended/rsyslog/rsyslog/bugfix-include-config.h-before-any-other-headers.patch
blob: 1048b423d78b0714360d93c250fca4bbb2cbd00b (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
51
Backport below commit for fixing:

lexer.l:34:14: error: expected identifier or '(' before '__extension__'

From 876bdd1c85353f7e254f4b4c3e228484860cea57 Mon Sep 17 00:00:00 2001
From: Tomas Heinrich <theinric@redhat.com>
Date: Mon, 17 Nov 2014 20:53:22 +0100
Subject: [PATCH] bugfix: include config.h before any other headers

For some reason, flex used to prepend several standard headers before
config.h. This prevented some conditional extension in these headers
from being defined.

The explicit prototype for strdup() shouldn't be required anymore as
it should be provided by string.h.

Upstream-Status: Backport
---
 grammar/lexer.l | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/grammar/lexer.l b/grammar/lexer.l
index 359cf9f..c834ef7 100644
--- a/grammar/lexer.l
+++ b/grammar/lexer.l
@@ -28,10 +28,12 @@
   * limitations under the License.
   */
 
-%{
+%top{
 #include "config.h"
+}
+
+%{
 #include "parserif.h"
-extern char *strdup(__const char*); /* somehow we may not get this from string.h... */
 %}
 
 %option noyywrap nodefault case-insensitive yylineno
@@ -67,6 +69,7 @@ extern char *strdup(__const char*); /* somehow we may not get this from string.h
 #include <ctype.h>
 #include <stdio.h>
 #include <stdlib.h>
+#include <string.h>
 #include <strings.h>
 #include <libestr.h>
 #include "rainerscript.h"
-- 
2.7.4