summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/command_lex.l5
-rw-r--r--lib/defun_lex.l7
2 files changed, 11 insertions, 1 deletions
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"