From bbadbdbfdbd60bcf0bbeaa983bc9ef3abc68cd6f Mon Sep 17 00:00:00 2001 From: orignal Date: Sun, 1 Sep 2024 15:23:14 -0400 Subject: [PATCH] Switch to C++17 for Mac OS X --- Makefile.homebrew | 2 +- Makefile.osx | 2 +- libi2pd/FS.cpp | 2 ++ libi2pd/FS.h | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Makefile.homebrew b/Makefile.homebrew index f19d64bb..e14ea955 100644 --- a/Makefile.homebrew +++ b/Makefile.homebrew @@ -5,7 +5,7 @@ SSLROOT = ${BREWROOT}/opt/openssl@1.1 UPNPROOT = ${BREWROOT}/opt/miniupnpc CXXFLAGS ?= ${CXX_DEBUG} -Wall -Wno-overloaded-virtual -NEEDED_CXXFLAGS ?= -std=c++11 +NEEDED_CXXFLAGS ?= -std=c++17 INCFLAGS ?= -I${SSLROOT}/include -I${BOOSTROOT}/include LDFLAGS ?= ${LD_DEBUG} DEFINES += -DMAC_OSX diff --git a/Makefile.osx b/Makefile.osx index 963d4898..48eb1a51 100644 --- a/Makefile.osx +++ b/Makefile.osx @@ -1,5 +1,5 @@ CXX = clang++ -CXXFLAGS := ${CXX_DEBUG} -Wall -std=c++11 +CXXFLAGS := ${CXX_DEBUG} -Wall -std=c++17 INCFLAGS = -I/usr/local/include DEFINES := -DMAC_OSX LDFLAGS := -Wl,-rpath,/usr/local/lib -L/usr/local/lib diff --git a/libi2pd/FS.cpp b/libi2pd/FS.cpp index 21993958..fdfd577e 100644 --- a/libi2pd/FS.cpp +++ b/libi2pd/FS.cpp @@ -9,7 +9,9 @@ #include #if defined(MAC_OSX) +#if !STD_FILESYSTEM #include +#endif #include #endif diff --git a/libi2pd/FS.h b/libi2pd/FS.h index 006ee68d..455012ba 100644 --- a/libi2pd/FS.h +++ b/libi2pd/FS.h @@ -16,7 +16,7 @@ #include #ifndef STD_FILESYSTEM -# if (!defined(MAC_OSX) && !TARGET_OS_SIMULATOR && \ +# if (!TARGET_OS_SIMULATOR && \ (__cplusplus >= 201703L) && __has_include()) // C++ 17 or higher and supports std::filesystem # define STD_FILESYSTEM 1 # else