From: David Lamparter Date: Sat, 8 Sep 2018 23:00:42 +0000 (+0200) Subject: lib: early-include "config.h" in flex lexers X-Git-Tag: frr-7.1-dev~380^2 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=7b34167d7dac6e898c49c675cfc80ae68c64bc98;p=mirror%2Ffrr.git lib: early-include "config.h" in flex lexers This is neccessary to get _FILE_OFFSET_BITS right. Signed-off-by: David Lamparter --- 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"