Issue 325 - When building regex for Windows, don't repeatedly define the global variable re_syntax_options.

This commit is contained in:
wb2osz 2021-04-10 20:00:47 -04:00
parent 7fa91dd551
commit 44df4a7612
2 changed files with 8 additions and 2 deletions

View File

@ -18,7 +18,7 @@ if(WIN32 OR CYGWIN) # windows
) )
set_target_properties(regex set_target_properties(regex
PROPERTIES COMPILE_FLAGS "-Dbool=int -Dtrue=1 -Dfalse=0 -DUSE_REGEX_STATIC" PROPERTIES COMPILE_FLAGS "-Dbool=int -Dtrue=1 -Dfalse=0 -DREGEX_STATIC"
) )
endif() endif()

View File

@ -35,17 +35,23 @@
#if (defined __WIN32__) || (defined _WIN32) #if (defined __WIN32__) || (defined _WIN32)
# ifdef BUILD_REGEX_DLL # ifdef BUILD_REGEX_DLL
# define REGEX_DLL_IMPEXP __DLL_EXPORT__ # define REGEX_DLL_IMPEXP __DLL_EXPORT__
# define REGEX_VARIABLE_IMPEXP __DLL_EXPORT__
# elif defined(REGEX_STATIC) # elif defined(REGEX_STATIC)
# define REGEX_DLL_IMPEXP # define REGEX_DLL_IMPEXP
# define REGEX_VARIABLE_IMPEXP
# elif defined (USE_REGEX_DLL) # elif defined (USE_REGEX_DLL)
# define REGEX_DLL_IMPEXP __DLL_IMPORT__ # define REGEX_DLL_IMPEXP __DLL_IMPORT__
# define REGEX_VARIABLE_IMPEXP __DLL_IMPORT__
# elif defined (USE_REGEX_STATIC) # elif defined (USE_REGEX_STATIC)
# define REGEX_DLL_IMPEXP # define REGEX_DLL_IMPEXP
# define REGEX_VARIABLE_IMPEXP extern
# else /* assume USE_REGEX_DLL */ # else /* assume USE_REGEX_DLL */
# define REGEX_DLL_IMPEXP __DLL_IMPORT__ # define REGEX_DLL_IMPEXP __DLL_IMPORT__
# define REGEX_VARIABLE_IMPEXP __DLL_IMPORT__
# endif # endif
#else /* __WIN32__ */ #else /* __WIN32__ */
# define REGEX_DLL_IMPEXP # define REGEX_DLL_IMPEXP
# define REGEX_VARIABLE_IMPEXP
#endif #endif
/* Allow the use in C++ code. */ /* Allow the use in C++ code. */
@ -202,7 +208,7 @@ typedef unsigned long int reg_syntax_t;
some interfaces). When a regexp is compiled, the syntax used is some interfaces). When a regexp is compiled, the syntax used is
stored in the pattern buffer, so changing this does not affect stored in the pattern buffer, so changing this does not affect
already-compiled regexps. */ already-compiled regexps. */
REGEX_DLL_IMPEXP reg_syntax_t re_syntax_options; REGEX_VARIABLE_IMPEXP reg_syntax_t re_syntax_options;
/* Define combinations of the above bits for the standard possibilities. /* Define combinations of the above bits for the standard possibilities.
(The [[[ comments delimit what gets put into the Texinfo file, so (The [[[ comments delimit what gets put into the Texinfo file, so