summarylogtreecommitdiffstats
path: root/flex_fix.patch
blob: 6218bc422397e20d43ca0b448fc9a78379f9f83b (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
From 7573939745b6cf62caa04cbcfcfa6982ba036542 Mon Sep 17 00:00:00 2001
From: nvinson234 <nvinson234@gmail.com>
Date: Sun, 1 Jan 2017 20:24:49 +0100
Subject: [PATCH] undefined reference yywrap in winhlp32/macro.lex.yy.c
 (flex-2.6.3)

flex-2.6.3 uses C preprocessor macros to change the prefix of its functions
from the standard yy to a user-defined one. This is a change in Flex behavior
and causes wine to fail with any version of Flex newer than 2.6.1.

The failure is caused because programs/winhlp32/macros.lex.l only defines the
yywrap macro if it is not already defined. The end result is C code that is
looking for an undefined yywrap() function.

I have attached a patch that fixes this issue by removing the yywrap macro check and definition from macros.lex.l and adding the noyywrap flex option.
---
 programs/winhlp32/macro.lex.l | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/programs/winhlp32/macro.lex.l b/programs/winhlp32/macro.lex.l
index 8f6945ca98..ff8a4832d3 100644
--- a/programs/winhlp32/macro.lex.l
+++ b/programs/winhlp32/macro.lex.l
@@ -20,7 +20,7 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
 %}
-%option noinput nounput never-interactive 8bit
+%option noinput nounput noyywrap never-interactive 8bit
 %x quote
 %{
 #include "config.h"
@@ -367,7 +367,3 @@ WINHELP_WINDOW* MACRO_CurrentWindow(void)
 {
     return lex_data ? lex_data->window : Globals.active_win;
 }
-
-#ifndef yywrap
-int yywrap(void) { return 1; }
-#endif
-- 
2.11.0