Skip to content

Commit

Permalink
Bump the C++ version from C++11 to C++17
Browse files Browse the repository at this point in the history
This will allow the usage of more modern features in the future.
  • Loading branch information
MirkoDziadzka committed Feb 9, 2024
1 parent ca5f516 commit 367a871
Show file tree
Hide file tree
Showing 11 changed files with 14 additions and 15 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ Windows build is not ready yet.

## Dependencies

This library is written in C++ using the C++11 standards. It also uses Flex
This library is written in C++ using the C++17 standards. It also uses Flex
and Yacc to produce the “Sec Rules Language” parser. Other, mandatory dependencies include YAJL, as ModSecurity uses JSON for producing logs and its testing framework, libpcre (not yet mandatory) for processing regular expressions in SecRules, and libXML2 (not yet mandatory) which is used for parsing XML requests.

All others dependencies are related to operators specified within SecRules or configuration directives and may not be required for compilation. A short list of such dependencies is as follows:
Expand Down
4 changes: 2 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ AC_PROG_MAKE_SET
PKG_PROG_PKG_CONFIG


# Check if the compiler is c++11 compatible.
# AX_CXX_COMPILE_STDCXX_11(,mandatory)
# Check if the compiler is c++17 compatible.
# AX_CXX_COMPILE_STDCXX_17(,mandatory)

# Check for libinjection
if ! test -f "${srcdir}/others/libinjection/src/libinjection_html5.c"; then
Expand Down
2 changes: 1 addition & 1 deletion examples/reading_logs_via_rule_message/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ simple_request_LDFLAGS = \

simple_request_CPPFLAGS = \
$(GLOBAL_CFLAGS) \
-std=c++11 \
-std=c++17 \
-I$(top_builddir)/headers \
-I$(top_builddir) \
-g \
Expand Down
2 changes: 1 addition & 1 deletion examples/reading_logs_with_offset/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ read_LDFLAGS = \

read_CPPFLAGS = \
$(GLOBAL_CFLAGS) \
-std=c++11 \
-std=c++17 \
-I$(top_builddir)/headers \
-I$(top_builddir) \
-g \
Expand Down
2 changes: 1 addition & 1 deletion examples/using_bodies_in_chunks/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ simple_request_LDFLAGS = \

simple_request_CPPFLAGS = \
$(GLOBAL_CFLAGS) \
-std=c++11 \
-std=c++17 \
-I$(top_builddir)/headers \
-I$(top_builddir) \
-g \
Expand Down
2 changes: 1 addition & 1 deletion src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ libmodsecurity_la_CFLAGS =


libmodsecurity_la_CPPFLAGS = \
-std=c++11 \
-std=c++17 \
-I.. \
-g \
-I../others \
Expand Down
3 changes: 1 addition & 2 deletions src/parser/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,10 @@ libmodsec_parser_la_SOURCES = \
test.cc

libmodsec_parser_la_CPPFLAGS = \
-std=c++11 \
-std=c++17 \
-I../.. \
-I../../headers \
-I../../others \
-std=c++11 \
-I.. \
-g \
-fPIC \
Expand Down
6 changes: 3 additions & 3 deletions test/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ unit_tests_LDFLAGS = \


unit_tests_CPPFLAGS = \
-std=c++11 \
-std=c++17 \
-Icommon \
-I../ \
-g \
Expand Down Expand Up @@ -126,7 +126,7 @@ regression_tests_LDFLAGS = \


regression_tests_CPPFLAGS = \
-std=c++11 \
-std=c++17 \
-Icommon \
-I../ \
-g \
Expand Down Expand Up @@ -179,7 +179,7 @@ rules_optimization_LDFLAGS = \
$(YAJL_LDFLAGS)

rules_optimization_CPPFLAGS = \
-std=c++11 \
-std=c++17 \
-Icommon \
-I../ \
-g \
Expand Down
2 changes: 1 addition & 1 deletion test/benchmark/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ benchmark_LDFLAGS = \
$(LUA_LDFLAGS)

benchmark_CPPFLAGS = \
-std=c++11 \
-std=c++17 \
-I$(top_builddir)/headers \
$(GLOBAL_CPPFLAGS) \
$(PCRE_CFLAGS) \
Expand Down
2 changes: 1 addition & 1 deletion test/fuzzer/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ afl_fuzzer_LDADD = \


afl_fuzzer_CPPFLAGS = \
-std=c++11 \
-std=c++17 \
-Icommon \
-I../ \
-I../../ \
Expand Down
2 changes: 1 addition & 1 deletion tools/rules-check/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ modsec_rules_check_LDFLAGS = \
$(YAJL_LDFLAGS)

modsec_rules_check_CPPFLAGS = \
-std=c++11 \
-std=c++17 \
-I$(top_builddir)/headers \
$(GLOBAL_CPPFLAGS) \
$(PCRE_CFLAGS) \
Expand Down

0 comments on commit 367a871

Please sign in to comment.