regex: Move the defines to a config header and include it unconditionally
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
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9b9ba0e..45ab121 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -32,7 +32,6 @@ ELSE()
# Windows doesn't understand POSIX regex on its own
INCLUDE_DIRECTORIES(deps/regex)
SET(SRC_REGEX deps/regex/regex.c)
- ADD_DEFINITIONS(-DGAWK -DNO_MBSUPPORT)
ENDIF()
IF (ZLIB_FOUND)
diff --git a/deps/regex/config.h b/deps/regex/config.h
new file mode 100644
index 0000000..9537069
--- /dev/null
+++ b/deps/regex/config.h
@@ -0,0 +1,7 @@
+#ifndef _REGEX_CONFIG_H_
+#define _REGEX_CONFIG_H_
+
+# define GAWK
+# define NO_MBSUPPORT
+
+#endif
diff --git a/deps/regex/regex.c b/deps/regex/regex.c
index 3dd8dfa..f9a8c9b 100644
--- a/deps/regex/regex.c
+++ b/deps/regex/regex.c
@@ -18,9 +18,7 @@
Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA. */
-#ifdef HAVE_CONFIG_H
#include "config.h"
-#endif
/* Make sure noone compiles this code with a C++ compiler. */
#ifdef __cplusplus