From 7b34167d7dac6e898c49c675cfc80ae68c64bc98 Mon Sep 17 00:00:00 2001 From: David Lamparter Date: Sun, 9 Sep 2018 01:00:42 +0200 Subject: [PATCH] lib: early-include "config.h" in flex lexers This is neccessary to get _FILE_OFFSET_BITS right. Signed-off-by: David Lamparter --- lib/command_lex.l | 5 +++++ lib/defun_lex.l | 7 ++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/command_lex.l b/lib/command_lex.l index 0d6e6ee7e5..3b18b58a2e 100644 --- a/lib/command_lex.l +++ b/lib/command_lex.l @@ -22,6 +22,11 @@ * 02111-1307, USA. */ +%top{ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif +} %{ /* ignore flex generated code in static analyzer */ #ifndef __clang_analyzer__ diff --git a/lib/defun_lex.l b/lib/defun_lex.l index d901c26a2e..6c0805a4fa 100644 --- a/lib/defun_lex.l +++ b/lib/defun_lex.l @@ -1,4 +1,3 @@ -%{ /* * clippy (CLI preparator in python) C pseudo-lexer * Copyright (C) 2016-2017 David Lamparter for NetDEF, Inc. @@ -34,6 +33,12 @@ * code documentation in it. */ +%top{ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif +} +%{ /* ignore harmless bugs in old versions of flex */ #pragma GCC diagnostic ignored "-Wsign-compare" #pragma GCC diagnostic ignored "-Wunused-value" -- 2.39.5