From f6baf9dc23392b3d4cd2e117fea1be9e39f3ffee Mon Sep 17 00:00:00 2001 From: Dan Smith Date: Thu, 3 Aug 2023 12:41:14 -0400 Subject: [PATCH] Squashed 'externals/nitro/' changes from 9e4ce0b58..eae92928f eae92928f Merge commit '21f63a84759d9140dff34e3e84909c0c16934508' into cpp17 21f63a847 Squashed 'externals/coda-oss/' changes from b4aa8b9218..ae5bc9c247 40b25f997 Merge branch 'main' into cpp17 1db58601e Squashed 'externals/coda-oss/' changes from a956f999fe..b4aa8b9218 5e8170bbb Merge commit '1db58601e050fc131504d188f5405ab2a01d657a' into cpp17 2f85834cf latest from CODA-OSS eedbce82b Merge branch 'develop/remove-cpp11-workarounds' into cpp17 1c71702e3 latest from 'main' 27fe4ed53 latest from CODA-OSS fe63430e5 merge main a901d5707 Squashed 'externals/coda-oss/' changes from 5f1e5d3537..a956f999fe 75806c5bc Merge commit 'a901d570779dfc6d813a868896283887135d9ee4' into cpp17 d9ead0692 latest from CODA-OSS 2e70f9299 Merge branch 'main' into cpp17 a90a2bd1f Merge commit '42d858e67d4415a61389984f8b3d774a71c7d82a' into cpp17 42d858e67 Squashed 'externals/coda-oss/' changes from 710754a00..5f1e5d353 c64c50c8e develop/sync_externals 06745921e Merge commit '629dc826ae47773e520433a3107b7af429a01209' into cpp17 629dc826a Squashed 'externals/coda-oss/' changes from 7819c2a85..710754a00 28300d67d Merge branch 'main' into cpp17 5b6604e0a Test and Test++ are now in UnitTest f498e03b4 NOMINMAX might already be #define'd 3de2fd3b7 more errors with compiler on Github 0a8d8addf build with C++17 f8aeaf4b8 Squashed 'externals/coda-oss/' changes from ddf69c0d54..7819c2a85b 750a4f644 Merge commit 'f8aeaf4b8c0e8d6d8bf8d79b93a20bec2d8ec2d0' into cpp17 b56065564 latest from CODA-OSS 6a37a24c2 merge main 7beec1c87 Merge branch 'main' into cpp17 ceb66da9b UseStandardPreprocessor fc077ed1a latest from CODA-OSS a68f87d21 restore C++17, build with C11 da324df5a Squashed 'externals/coda-oss/' changes from 1fe2b7d0dc..ddf69c0d54 326db63fc Merge commit 'da324df5aff2dd4f07b77774f6e7b0b6e049ff59' into cpp17 3478ec944 latest from CODA-OSS ba58b7236 Merge branch 'main' into cpp17 8a0b90d8b Squashed 'externals/coda-oss/' changes from c9fbbbf6c5..1fe2b7d0dc c255b18c7 Merge commit '8a0b90d8b0addd02e4549313ce23c510725730a2' into cpp17 7ce6685ea latest from CODA-OSS 93cdfb71b develop/sync_externals b3026490a Merge branch 'main' into cpp17 4754f4f5c Squashed 'externals/coda-oss/' changes from cfc5f99f26..c9fbbbf6c5 85cb2ab7d Merge commit '4754f4f5c5761fd0d9e33bd4b0419bbbe35b72de' into cpp17 0e80763e1 latest from coda-oss 99b0b070d Merge branch 'main' into cpp17 ed0f36b55 Squashed 'externals/coda-oss/' changes from c9b93bd5a1..cfc5f99f26 a576517d2 Merge commit 'ed0f36b55d8dbfe8aee0ec9e947cb21d51b1f37a' into cpp17 0f04ee70a latest from CODA-OSS 91b591ed0 Merge branch 'main' into cpp17 56846a674 Squashed 'externals/coda-oss/' changes from 47c8051958..c9b93bd5a1 26500239d Merge commit '56846a674a69b0c6a2b3b2d0391599f71504e8b1' into cpp17 8c9ecc211 develop/sync_externals 56a24484b Merge branch 'main' into cpp17 126aedf5d Squashed 'externals/coda-oss/' changes from 113db4a49d..47c8051958 f093441aa Merge commit '126aedf5d9b4f47c021ce02e320bbbfd111751bd' into cpp17 25e847298 Merge branch 'main' into cpp17 4f72880b7 fix build errors d74a68191 Merge branch 'main' into cpp17 63bc64778 Squashed 'externals/coda-oss/' changes from d95aa8dd3b..113db4a49d f5223165c Merge commit '63bc647787ac53602074aeeedd3565522ea7b170' into cpp17 1ab864800 latest from coda-oss fc16938bc merge develop/sync_externals e4b454976 Merge branch 'main' into cpp17 3822f6ef3 Merge branch 'main' into cpp17 d2ea428ce Squashed 'externals/coda-oss/' changes from 7b90b5a46b..d95aa8dd3b f4ba98270 Merge commit 'd2ea428ce2ead7e3330b671f2b4916fa5fe1c862' into cpp17 2f048ade3 Merge branch 'main' into cpp17 cdda3982c Merge branch 'main' into cpp17 b660acc8d Merge branch 'main' into cpp17 842bcb3c7 Merge commit 'b4e35176b5f190a9783b8e02d2a6463163cea097' into cpp17 b4e35176b Squashed 'externals/coda-oss/' changes from 8abcb1825d..7b90b5a46b 73d3dbaab latest from coda-oss 318a3825b Squashed 'externals/coda-oss/' changes from 808c64e9ec..8abcb1825d 9e5cd6e6f Merge commit '318a3825b20d34fdbfd12a4c5bf800f8b9ed162b' into cpp17 1376ba1e8 Merge branch 'main' into cpp17 f54a7d7f3 Squashed 'externals/coda-oss/' changes from f6489b6bef..808c64e9ec abf559925 Merge commit 'f54a7d7f3f798c494fa696b887f7d435929d4e32' into cpp17 e3aaaa762 Merge branch 'develop/sync_externals' into cpp17 7c57010b4 Squashed 'externals/coda-oss/' changes from 857ff0af32..f6489b6bef afdbfb7c9 Merge commit '7c57010b4b7fa82a72c7b4bf6594634ef5c97d9d' into develop/sync_externals 6c73d1ed5 latest from coda-oss c185cac62 Merge branch 'main' into develop/sync_externals 26558068d Merge branch 'main' into cpp17 086114bf2 Merge commit 'e86af796d70ccb872d09d096aa4a13d319f28fc7' into cpp17 e86af796d Squashed 'externals/coda-oss/' changes from e87c32b4de..cf1a346d0f 8ccaf3c59 merge 'main' e0d4f4a3b Merge branch 'main' into cpp17 a602cddde Squashed 'externals/coda-oss/' changes from e87c32b4de..857ff0af32 d8b20d40a Merge commit 'a602cdddedba762a26def51fa3507b7c83475441' into develop/sync_externals 86b0208fc copy_externals 1d9473991 Merge branch 'main' into develop/sync_externals 5cde06021 Merge commit 'fa991cfdcbcfe692891106f537f51202566d7772' into develop/sync_externals fa991cfdc Squashed 'externals/coda-oss/' changes from cbfb20ce2e..e87c32b4de c34a8a817 restore 'main' 4d155ad54 restore 'main' 4706b3910 Merge branch 'main' into develop/sync_externals e4a01a0af Merge branch 'master' into develop/sync_externals 13d51a6ba fix compiler erros in test_VectorN.cpp 50cf5d5af copy_externals.csh 513c0189c sync_externals.csh 383f59046 Squashed 'externals/coda-oss/' changes from 67d6362bc..cbfb20ce2 a6d2aadc5 copy_externals.csh 20cfa0d03 don't do push after sync'ing externals b782101ab HDF5 source code (not built) bbb9a45b8 trying to fix build error 7a3c36f1e Merge branch 'main' into cpp17 51971c90a Merge commit 'd998531050f185654b8c3f9af37a3bf9be3df4f8' into cpp17 d99853105 Squashed 'externals/coda-oss/' changes from df07c512d..26de66952 d3cd740df merge 'main' 7ada2e660 Merge branch 'main' into cpp17 df866e394 Squashed 'externals/coda-oss/' changes from f1ad69fd4..df07c512d 339684c3d Merge commit 'df866e394aafccd455e41472f55dda4cbcca20e5' into cpp17 712806d4c latest from coda-oss e69bd4d19 Merge branch 'main' into cpp17 f62e26980 Squashed 'externals/coda-oss/' changes from fd75f84b6..f1ad69fd4 aaeddf829 Merge commit 'f62e26980c3544c102e95f7c9798bd29850d9e39' into cpp17 6729a5fed latest from coda-oss da371ba2e latest from coda-oss d963ab353 Merge commit 'faceec5e82ce54ce18e99dc1a5499eefa035d9b2' into cpp17 faceec5e8 Squashed 'externals/coda-oss/' changes from ce34286c8..fd75f84b6 7921a1a89 Merge commit '046ede62b6d5499a50d34726b42158b2fedc8b1b' into cpp17 046ede62b Squashed 'externals/coda-oss/' changes from 8d7de5125..ce34286c8 a9a3e9a40 merge develop/sync_externals ec20472a3 Merge commit '108d441d43190f57f8b024e7966d2e117232e969' into cpp17 108d441d4 Squashed 'externals/coda-oss/' changes from 5e0f5d614..8d7de5125 3fca41574 restore ++17 56b5ff4ff restore ++17 ceaeb792d Merge branch 'main' into cpp17 3977f7e83 merge 'main' 53eca9ad0 Squashed 'externals/coda-oss/' changes from 22a7eab30..5e0f5d614 156fd6a13 Merge commit '53eca9ad0c171f1a18e9ed7495cfce3e82ead721' into cpp17 9fecb535e merge 'main' 9bd17f85c Squashed 'externals/coda-oss/' changes from 3bcb3d874..22a7eab30 988fc972b Merge commit '9bd17f85cecc8fd349bc7ca211433e30922264f1' into cpp17 ae797e4c2 latest from coda-oss e0278bc59 merge 'main' d9884ada5 --depth 1 for git-clone d6d5e0818 Squashed 'externals/coda-oss/' changes from b8d501278..3bcb3d874 24929d6ee Merge commit 'd6d5e0818ae933943c0adb62161830a543ab77ca' into cpp17 3cd8b20d7 -std=c++17 35cb91694 Merge branch 'main' into cpp17 50dcd938b latest from coda-oss c6827bf0a merge sync_externals 75a4c90d2 restore C++17 changes 79c6d24b4 Merge branch 'main' into cpp17 d742e9cdf Squashed 'externals/coda-oss/' changes from cc838246f..b8d501278 816060564 Merge commit 'd742e9cdf796ed16c9ac7a88b2383b2e0f263561' into cpp17 42732d069 Merge branch 'main' into cpp17 ff7303c78 Merge commit '99697cd33a96a3e78f302fd623ab75d4be3efd2d' into cpp17 99697cd33 Squashed 'externals/coda-oss/' changes from c800b5647..cc838246f b7a06563d Merge branch 'main' into cpp17 b073a6d5b copy from 'cpp17' instead of 'main' 8ddcd60f1 Merge branch 'main' into cpp17 b39f0c61e Squashed 'externals/coda-oss/' changes from ab45464820..c800b56478 b569cd66f Merge commit 'b39f0c61ec6f5d54658b589cd4731d0e5abb176d' into cpp17 d56801002 Merge branch 'main' into cpp17 42c7d8ed3 Merge commit '6cec868b0ef251e71186263a8af9097ed9a96d20' into cpp17 6cec868b0 Squashed 'externals/coda-oss/' changes from 4d77506f85..c800b56478 f25c9f61e Merge branch 'main' into cpp17 7959c3e15 Merge commit '08bb1be7ae24da2ca3e7a752f4f691b8eee30533' into cpp17 08bb1be7a Squashed 'externals/coda-oss/' changes from dc36dd271a..4d77506f85 88fe35b60 latest from coda-oss 09d8ac63a Merge branch 'main' into cpp17 8aec3ad2b Merge commit '31308dfa129420ff8a67ab96834218edda47a16b' into cpp17 31308dfa1 Squashed 'externals/coda-oss/' changes from 67d6362bcf..dc36dd271a c24d1c98f restore 'noexcept' changes to HDF5 01940338e latest from coda-oss 10554bfd3 Merge branch 'main' into cpp17 1d2edc8b5 Merge branch 'main' into cpp17 c0404e956 pull from 'cpp17' branch on coda-oss 0c62ba997 change C++14 flag to C++17 6be20d4ff SWIG bindings need "path" typedef 9b42b8566 remove last traces of C++11 and C++14 support 7558a0066 latest from coda-oss 16148a308 Squashed commit of the following: b0f60ead3 remove last traces of auto_ptr, removed in C++17 868e61ba4 Squashed commit of the following: d6720c474 std::filesystem is supported by all C++17 compilers :-( 4d62a2721 Merge branch 'main' into main-cpp17 936c785f7 Update test_functional.h a9b3f0f9c turn off a couple of warnings that can't be fixed 2acca4b73 latest from coda-oss:main-cpp17 bab327b1d build with C++17 git-subtree-dir: externals/nitro git-subtree-split: eae92928ffc29295297439a71bf9eee91c233975 --- CMakeLists.txt | 2 +- UnitTest/UnitTest.vcxproj | 7 +++++- UnitTest/pch.h | 1 + copy_externals.csh | 2 +- .../.github/workflows/build_unittest.yml | 6 ++++- externals/coda-oss/CMakeLists.txt | 2 +- externals/coda-oss/UnitTest/UnitTest.vcxproj | 5 ++++ externals/coda-oss/build/build.py | 17 ++++--------- externals/coda-oss/modules/c++/CMakeLists.txt | 1 - .../coda-oss/modules/c++/coda-oss.vcxproj | 6 +++++ .../modules/c++/coda-oss.vcxproj.filters | 6 ++--- .../c++/coda_oss/include/coda_oss/CPlusPlus.h | 4 +-- .../c++/coda_oss/include/coda_oss/cstddef.h | 17 ++----------- .../coda_oss/include/coda_oss/type_traits.h | 2 -- .../c++/io/include/io/FileInputStreamIOS.h | 15 +++-------- .../c++/io/include/io/FileOutputStreamOS.h | 18 ++++--------- .../c++/io/source/FileOutputStreamOS.cpp | 4 +-- .../c++/logging/include/logging/Setup.h | 17 +++---------- .../modules/c++/logging/source/Setup.cpp | 4 +-- .../modules/c++/mt/include/mt/ThreadGroup.h | 12 ++++++++- .../modules/c++/mt/source/ThreadGroup.cpp | 17 +++++++++++++ externals/coda-oss/modules/c++/pch.h | 1 + .../modules/c++/std/include/std/cstddef | 25 +------------------ .../modules/c++/std/include/std/type_traits | 21 +--------------- .../modules/c++/str/include/str/Manip.h | 9 ------- modules/c++/nitf-c++.vcxproj | 6 +++++ .../nitf/apps/show_nitf++/show_nitf++.vcxproj | 6 +++++ modules/c++/nitf/include/nitf/SubWindow.hpp | 6 ----- modules/c++/nitf/include/nitf/System.hpp | 4 --- modules/c/j2k/J2KCompress.vcxproj | 6 +++++ modules/c/j2k/J2KDecompress.vcxproj | 6 +++++ modules/c/nitf-c.vcxproj | 7 +++++- modules/c/nitf/ACCHZB.vcxproj | 6 +++++ modules/c/nitf/ACCPOB.vcxproj | 6 +++++ modules/c/nitf/ACFTA.vcxproj | 6 +++++ modules/c/nitf/AIMIDB.vcxproj | 6 +++++ modules/c/nitf/CSCRNA.vcxproj | 6 +++++ modules/c/nitf/CSEXRB.vcxproj | 6 +++++ modules/c/nitf/ENGRDA.vcxproj | 6 +++++ modules/c/nitf/HISTOA.vcxproj | 6 +++++ modules/c/nitf/JITCID.vcxproj | 6 +++++ modules/c/nitf/PTPRAA.vcxproj | 6 +++++ modules/c/nitf/RPFHDR.vcxproj | 6 +++++ modules/c/nitf/XML_DATA_CONTENT.vcxproj | 6 +++++ sync_externals.csh | 5 ++-- 45 files changed, 191 insertions(+), 148 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6bd74b7352..65b046fb7b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.14) project(nitro) -set(CMAKE_CXX_STANDARD 14) +set(CMAKE_CXX_STANDARD 17) set(CXX_STANDARD_REQUIRED true) if (${CMAKE_PROJECT_NAME} STREQUAL nitro) diff --git a/UnitTest/UnitTest.vcxproj b/UnitTest/UnitTest.vcxproj index d936467254..b7b3aefd73 100644 --- a/UnitTest/UnitTest.vcxproj +++ b/UnitTest/UnitTest.vcxproj @@ -68,6 +68,9 @@ true true true + stdcpp17 + stdc11 + true Windows @@ -86,11 +89,13 @@ true pch.h AdvancedVectorExtensions2 - Guard true true true true + stdcpp17 + stdc11 + true Windows diff --git a/UnitTest/pch.h b/UnitTest/pch.h index ab78e8ef45..5c51bbb0bd 100644 --- a/UnitTest/pch.h +++ b/UnitTest/pch.h @@ -13,6 +13,7 @@ #define NOMINMAX #pragma warning(push) #pragma warning(disable: 5039) // '...': pointer or reference to potentially throwing function passed to 'extern "C"' function under -EHc. Undefined behavior may occur if this function throws an exception. +#pragma warning(disable: 5105) // macro expansion producing '...' has undefined behavior #include #pragma warning(pop) #pragma comment(lib, "ws2_32") diff --git a/copy_externals.csh b/copy_externals.csh index 1674c143d1..4f2d5701c1 100755 --- a/copy_externals.csh +++ b/copy_externals.csh @@ -1,7 +1,7 @@ #!/bin/csh -f rm -r -f tmp && mkdir tmp && cd tmp -git clone --depth 1 -b main git@github.com:mdaus/coda-oss.git +git clone --depth 1 -b cpp17 git@github.com:mdaus/coda-oss.git rm -r -f coda-oss/.git cd .. diff --git a/externals/coda-oss/.github/workflows/build_unittest.yml b/externals/coda-oss/.github/workflows/build_unittest.yml index b96a17a63e..13c78c13e4 100644 --- a/externals/coda-oss/.github/workflows/build_unittest.yml +++ b/externals/coda-oss/.github/workflows/build_unittest.yml @@ -111,6 +111,8 @@ jobs: which python mkdir target cd target + export CC=gcc-10 + export CXX=g++-10 cmake .. -DCMAKE_INSTALL_PREFIX=install${{ matrix.os }}CMake-Github -DPYTHON_VERSION=${{ matrix.python-version }} -DENABLE_SWIG=ON - name: build run: | @@ -130,7 +132,7 @@ jobs: build-waf: strategy: matrix: - os: [ubuntu-latest, windows-2019] + os: [ubuntu-latest] python-version: ['3.7'] debugging: ['--enable-debugging', ''] name: ${{ matrix.os }}-${{ matrix.python-version }}-waf${{ matrix.debugging }} @@ -146,6 +148,8 @@ jobs: run: | pip install numpy mkdir install${{ matrix.os }}Waf-Github + export CC=gcc-10 + export CXX=g++-10 python waf configure --prefix="$PWD/install${{ matrix.os }}Waf-Github" --enable-swig ${{ matrix.debugging }} - name: configure_without_swig if: ${{ matrix.os == 'windows-2019' }} diff --git a/externals/coda-oss/CMakeLists.txt b/externals/coda-oss/CMakeLists.txt index 4b1bc2c645..6ef7c1b353 100644 --- a/externals/coda-oss/CMakeLists.txt +++ b/externals/coda-oss/CMakeLists.txt @@ -5,7 +5,7 @@ cmake_minimum_required(VERSION 3.14) project(coda-oss) -set(CMAKE_CXX_STANDARD 14) +set(CMAKE_CXX_STANDARD 17) set(CXX_STANDARD_REQUIRED true) if (EXISTS "${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") diff --git a/externals/coda-oss/UnitTest/UnitTest.vcxproj b/externals/coda-oss/UnitTest/UnitTest.vcxproj index 835f574dca..28f6169955 100644 --- a/externals/coda-oss/UnitTest/UnitTest.vcxproj +++ b/externals/coda-oss/UnitTest/UnitTest.vcxproj @@ -71,6 +71,9 @@ true /Zc:__cplusplus %(AdditionalOptions) AdvancedVectorExtensions2 + stdcpp17 + stdc11 + MultiThreadedDebugDLL Windows @@ -96,6 +99,8 @@ true /Zc:__cplusplus %(AdditionalOptions) AdvancedVectorExtensions2 + stdcpp17 + stdc11 Windows diff --git a/externals/coda-oss/build/build.py b/externals/coda-oss/build/build.py index 1c9c5eca2a..a5766d1451 100644 --- a/externals/coda-oss/build/build.py +++ b/externals/coda-oss/build/build.py @@ -756,7 +756,7 @@ def options(opt): opt.add_option('--enable-debugging', action='store_true', dest='debugging', help='Enable debugging') opt.add_option('--enable-cpp11', action='callback', callback=deprecated_callback) - opt.add_option('--enable-cpp17', action='store_true', dest='enablecpp17') + opt.add_option('--enable-cpp17', action='callback', callback=deprecated_callback) opt.add_option('--enable-64bit', action='callback', callback=deprecated_callback) opt.add_option('--enable-32bit', action='callback', callback=deprecated_callback) opt.add_option('--with-cflags', action='store', nargs=1, dest='cflags', @@ -812,7 +812,7 @@ def options(opt): 'results. NOOP if junit_xml cannot be imported') -def ensureCpp14Support(self): +def ensureCpp17Support(self): # DEPRECATED. # Keeping for now in case downstream code is still looking for it self.env['cpp11support'] = True @@ -914,10 +914,7 @@ def configureCompilerOptions(self): config['cxx']['optz_fastest-possible'] = [ config['cxx']['optz_faster'], '-march=native' ] # -march=native instead of haswell self.env.append_value('CXXFLAGS', '-fPIC'.split()) - if not Options.options.enablecpp17: - gxxCompileFlags='-std=c++14' - else: - gxxCompileFlags='-std=c++17' + gxxCompileFlags='-std=c++17' self.env.append_value('CXXFLAGS', gxxCompileFlags.split()) # DEFINES and LINKFLAGS will apply to both gcc and g++ @@ -1027,11 +1024,7 @@ def configureCompilerOptions(self): '_LARGEFILE_SOURCE WIN32 _USE_MATH_DEFINES NOMINMAX WIN32_LEAN_AND_MEAN'.split() flags = '/UUNICODE /U_UNICODE /EHs /GR'.split() - #If building with cpp17 add flags/defines to enable auto_ptr - if Options.options.enablecpp17: - flags.append('/std:c++17') - else: - flags.append('/std:c++14') + flags.append('/std:c++17') self.env.append_value('DEFINES', defines) self.env.append_value('CXXFLAGS', flags) @@ -1252,7 +1245,7 @@ def configure(self): if Options.options._defs: env.append_unique('DEFINES', Options.options._defs.split(',')) configureCompilerOptions(self) - ensureCpp14Support(self) + ensureCpp17Support(self) env['PLATFORM'] = sys_platform diff --git a/externals/coda-oss/modules/c++/CMakeLists.txt b/externals/coda-oss/modules/c++/CMakeLists.txt index d8f84e9f98..d30fb57661 100644 --- a/externals/coda-oss/modules/c++/CMakeLists.txt +++ b/externals/coda-oss/modules/c++/CMakeLists.txt @@ -1,6 +1,5 @@ set(TARGET_LANGUAGE c++) -# turn on maximum warnings if (MSVC) # By default, there is a /W3 on the command-line from somewhere (?); adding # /Wn results in a compiler warning. diff --git a/externals/coda-oss/modules/c++/coda-oss.vcxproj b/externals/coda-oss/modules/c++/coda-oss.vcxproj index cd74689659..37306043f1 100644 --- a/externals/coda-oss/modules/c++/coda-oss.vcxproj +++ b/externals/coda-oss/modules/c++/coda-oss.vcxproj @@ -594,6 +594,9 @@ AdvancedVectorExtensions2 MultiThreadedDebugDLL true + stdcpp17 + stdc11 + true @@ -621,6 +624,9 @@ true /Zc:__cplusplus %(AdditionalOptions) AdvancedVectorExtensions2 + stdcpp17 + stdc11 + true diff --git a/externals/coda-oss/modules/c++/coda-oss.vcxproj.filters b/externals/coda-oss/modules/c++/coda-oss.vcxproj.filters index adb5a57f71..eca92c39c8 100644 --- a/externals/coda-oss/modules/c++/coda-oss.vcxproj.filters +++ b/externals/coda-oss/modules/c++/coda-oss.vcxproj.filters @@ -36,9 +36,6 @@ coda_oss - - coda_oss - coda_oss @@ -969,6 +966,9 @@ include + + coda_oss + diff --git a/externals/coda-oss/modules/c++/coda_oss/include/coda_oss/CPlusPlus.h b/externals/coda-oss/modules/c++/coda_oss/include/coda_oss/CPlusPlus.h index ab528a085b..887579a5c7 100644 --- a/externals/coda-oss/modules/c++/coda_oss/include/coda_oss/CPlusPlus.h +++ b/externals/coda-oss/modules/c++/coda_oss/include/coda_oss/CPlusPlus.h @@ -79,8 +79,8 @@ #define CODA_OSS_cpp20 (CODA_OSS_cplusplus >= CODA_OSS_cplusplus20) #define CODA_OSS_cpp23 (CODA_OSS_cplusplus >= CODA_OSS_cplusplus23) -#if !CODA_OSS_cpp14 -#error "Must compile with C++14 or greater." +#if !CODA_OSS_cpp17 +#error "Must compile with C++17 or greater." #endif // Get feature-testing macros: https://en.cppreference.com/w/cpp/feature_test diff --git a/externals/coda-oss/modules/c++/coda_oss/include/coda_oss/cstddef.h b/externals/coda-oss/modules/c++/coda_oss/include/coda_oss/cstddef.h index c8c51ed421..68a7ad5dce 100644 --- a/externals/coda-oss/modules/c++/coda_oss/include/coda_oss/cstddef.h +++ b/externals/coda-oss/modules/c++/coda_oss/include/coda_oss/cstddef.h @@ -18,28 +18,15 @@ * License along with this program; If not, http://www.gnu.org/licenses/. * */ +#pragma once #ifndef CODA_OSS_coda_oss_cstddef_h_INCLUDED_ #define CODA_OSS_coda_oss_cstddef_h_INCLUDED_ -#pragma once - -#include #include -#include - -// Need a fairly decent C++ compiler to use the real GSL. This brings in more than -// we really need for span (e.g., gsl::narrow()), but it keeps things simple. -#include "gsl/gsl.h" // not gsl/byte; need #pragma here to turn off warnings namespace coda_oss { - #if defined(GSL_BYTE_H) // the above #include'd gsl/byte - using gsl::byte; - #else // no gsl::byte, use our own - // https://en.cppreference.com/w/cpp/types/byte - enum class byte : unsigned char {}; - #endif // GSL_BYTE_H + using byte = std::byte; } -static_assert(!std::is_same::value, "'coda_oss::byte' should be a unique type."); #endif // CODA_OSS_coda_oss_cstddef_h_INCLUDED_ diff --git a/externals/coda-oss/modules/c++/coda_oss/include/coda_oss/type_traits.h b/externals/coda-oss/modules/c++/coda_oss/include/coda_oss/type_traits.h index 5c92c1d321..a5a3df63a7 100644 --- a/externals/coda-oss/modules/c++/coda_oss/include/coda_oss/type_traits.h +++ b/externals/coda-oss/modules/c++/coda_oss/include/coda_oss/type_traits.h @@ -24,8 +24,6 @@ #include -#include "CPlusPlus.h" - #include "coda_oss/namespace_.h" namespace coda_oss { diff --git a/externals/coda-oss/modules/c++/io/include/io/FileInputStreamIOS.h b/externals/coda-oss/modules/c++/io/include/io/FileInputStreamIOS.h index c23223edb0..704ffb238d 100644 --- a/externals/coda-oss/modules/c++/io/include/io/FileInputStreamIOS.h +++ b/externals/coda-oss/modules/c++/io/include/io/FileInputStreamIOS.h @@ -28,17 +28,15 @@ #include #include #include +#include + #include "except/Exception.h" -#include "sys/filesystem.h" #include "io/InputStream.h" #include "io/SeekableStreams.h" -#include "sys/CPlusPlus.h" -#if CODA_OSS_cpp17 -#include -#endif -/*! + + /*! * \file FileInputStreamIOS.h * \brief The InputStream representation of a file * \todo Redefine the readln function to use getline() @@ -70,13 +68,8 @@ class FileInputStreamIOS : public SeekableInputStream * \param inputFile The file name * \param mode The mode to open the file in */ - FileInputStreamIOS(const coda_oss::filesystem::path& inputFile, - std::ios::openmode mode = std::ios::in); - #if CODA_OSS_cpp17 FileInputStreamIOS(const std::filesystem::path& inputFile, std::ios::openmode mode = std::ios::in); - #endif - /*! * Alternate Constructor. Takes an input file and a mode diff --git a/externals/coda-oss/modules/c++/io/include/io/FileOutputStreamOS.h b/externals/coda-oss/modules/c++/io/include/io/FileOutputStreamOS.h index b8e70b893d..3d450cfc49 100644 --- a/externals/coda-oss/modules/c++/io/include/io/FileOutputStreamOS.h +++ b/externals/coda-oss/modules/c++/io/include/io/FileOutputStreamOS.h @@ -25,20 +25,15 @@ #pragma once #include +#include #include "config/Exports.h" #if !defined(USE_IO_STREAMS) #include "io/SeekableStreams.h" -#include "sys/filesystem.h" #include "sys/File.h" -#include "sys/CPlusPlus.h" -#if CODA_OSS_cpp17 -#include -#endif - /*! * \file FileOutputStream.h * \brief The OutputStream representation of a file @@ -64,17 +59,14 @@ class CODA_OSS_API FileOutputStreamOS : public SeekableOutputStream public: FileOutputStreamOS() = default; + using path = std::filesystem::path; // still used in SWIG bindings + /*! * Alternate Constructor. Takes an output file and a mode * \param outputFile The file name * \param creationFlags see sys::File */ - #if CODA_OSS_cpp17 - using path = std::filesystem::path; - #else - using path = coda_oss::filesystem::path; - #endif - FileOutputStreamOS(const path& outputFile, + FileOutputStreamOS(const std::filesystem::path& outputFile, int creationFlags = sys::File::CREATE | sys::File::TRUNCATE); //! Destructor, closes the file stream. @@ -100,7 +92,7 @@ class CODA_OSS_API FileOutputStreamOS : public SeekableOutputStream * \param file The file to open * \param creationFlags see sys::File */ - virtual void create(const path& str, + virtual void create(const std::filesystem::path& str, int creationFlags = sys::File::CREATE | sys::File::TRUNCATE); //! Close the file diff --git a/externals/coda-oss/modules/c++/io/source/FileOutputStreamOS.cpp b/externals/coda-oss/modules/c++/io/source/FileOutputStreamOS.cpp index 2f47f1f890..bce0aeb3fe 100644 --- a/externals/coda-oss/modules/c++/io/source/FileOutputStreamOS.cpp +++ b/externals/coda-oss/modules/c++/io/source/FileOutputStreamOS.cpp @@ -24,13 +24,13 @@ #if !defined(USE_IO_STREAMS) -io::FileOutputStreamOS::FileOutputStreamOS(const path& str, +io::FileOutputStreamOS::FileOutputStreamOS(const std::filesystem::path& str, int creationFlags) { mFile.create(str.string(), sys::File::WRITE_ONLY, creationFlags); } -void io::FileOutputStreamOS::create(const path& str_, +void io::FileOutputStreamOS::create(const std::filesystem::path& str_, int creationFlags) { const auto str = str_.string(); diff --git a/externals/coda-oss/modules/c++/logging/include/logging/Setup.h b/externals/coda-oss/modules/c++/logging/include/logging/Setup.h index 1f1e960c6f..cfd7280e7f 100644 --- a/externals/coda-oss/modules/c++/logging/include/logging/Setup.h +++ b/externals/coda-oss/modules/c++/logging/include/logging/Setup.h @@ -25,18 +25,14 @@ #include #include +#include -#include "sys/filesystem.h" #include "mem/SharedPtr.h" #include "logging/Logger.h" -#include "sys/CPlusPlus.h" -#if CODA_OSS_cpp17 -#include -#endif - namespace logging { +using path = std::filesystem::path; // still used in SWIG bindings /*! * \fn setupLogger @@ -52,15 +48,10 @@ namespace logging * \param logCount - number of rotating logs to keep (default: 0 no rotation) * \param logBytes - number of bytes per rotating log (default: 0 no rotation) */ -#if CODA_OSS_cpp17 -using path = std::filesystem::path; -#else -using path = coda_oss::filesystem::path; -#endif std::unique_ptr setupLogger( - const path& program, + const std::filesystem::path& program, const std::string& logLevel = "warning", - const path& logFile = "console", + const std::filesystem::path& logFile = "console", const std::string& logFormat = "[%p] (%d) %m", size_t logCount = 0, size_t logBytes = 0); diff --git a/externals/coda-oss/modules/c++/logging/source/Setup.cpp b/externals/coda-oss/modules/c++/logging/source/Setup.cpp index 3c1c363638..e1a7e6491e 100644 --- a/externals/coda-oss/modules/c++/logging/source/Setup.cpp +++ b/externals/coda-oss/modules/c++/logging/source/Setup.cpp @@ -33,9 +33,9 @@ #include "logging/XMLFormatter.h" std::unique_ptr -logging::setupLogger(const path& program_, +logging::setupLogger(const std::filesystem::path& program_, const std::string& logLevel, - const path& logFile_, + const std::filesystem::path& logFile_, const std::string& logFormat, size_t logCount, size_t logBytes) diff --git a/externals/coda-oss/modules/c++/mt/include/mt/ThreadGroup.h b/externals/coda-oss/modules/c++/mt/include/mt/ThreadGroup.h index e12cbf8a9b..7bba1cf263 100644 --- a/externals/coda-oss/modules/c++/mt/include/mt/ThreadGroup.h +++ b/externals/coda-oss/modules/c++/mt/include/mt/ThreadGroup.h @@ -81,9 +81,12 @@ struct CODA_OSS_API ThreadGroup /*! * Creates and starts a thread from a sys::Runnable. - * \param runnable auto_ptr to sys::Runnable + * \param runnable unique_ptr to sys::Runnable */ void createThread(std::unique_ptr&& runnable); + #if CODA_OSS_autoptr_is_std + void createThread(std::unique_ptr runnable); + #endif /*! * Waits for all threads to complete. @@ -161,6 +164,13 @@ struct CODA_OSS_API ThreadGroup mt::ThreadGroup& parentThreadGroup, std::unique_ptr&& threadInit = std::unique_ptr(nullptr)); + #if CODA_OSS_autoptr_is_std + ThreadGroupRunnable( + std::unique_ptr runnable, + mt::ThreadGroup& parentThreadGroup, + std::unique_ptr threadInit = + std::unique_ptr(nullptr)); + #endif ThreadGroupRunnable(const ThreadGroupRunnable&) = delete; ThreadGroupRunnable& operator=(const ThreadGroupRunnable&) = delete; diff --git a/externals/coda-oss/modules/c++/mt/source/ThreadGroup.cpp b/externals/coda-oss/modules/c++/mt/source/ThreadGroup.cpp index 0a3616a39f..068a11fc97 100644 --- a/externals/coda-oss/modules/c++/mt/source/ThreadGroup.cpp +++ b/externals/coda-oss/modules/c++/mt/source/ThreadGroup.cpp @@ -71,6 +71,12 @@ void ThreadGroup::createThread(std::unique_ptr&& runnable) mThreads.push_back(thread); thread->start(); } +#if CODA_OSS_autoptr_is_std +void ThreadGroup::createThread(std::unique_ptr runnable) +{ + createThread(std::unique_ptr(runnable.release())); +} +#endif void ThreadGroup::joinAll() { @@ -135,6 +141,17 @@ ThreadGroup::ThreadGroupRunnable::ThreadGroupRunnable( mCPUInit(std::move(threadInit)) { } +#if CODA_OSS_autoptr_is_std +ThreadGroup::ThreadGroupRunnable::ThreadGroupRunnable( + std::unique_ptr runnable, + ThreadGroup& parentThreadGroup, + std::unique_ptr threadInit) : + ThreadGroupRunnable(std::unique_ptr(runnable.release()), + parentThreadGroup, + std::unique_ptr(threadInit.release())) +{ +} +#endif void ThreadGroup::ThreadGroupRunnable::run() { diff --git a/externals/coda-oss/modules/c++/pch.h b/externals/coda-oss/modules/c++/pch.h index 18067f14df..26ba3ed051 100644 --- a/externals/coda-oss/modules/c++/pch.h +++ b/externals/coda-oss/modules/c++/pch.h @@ -45,6 +45,7 @@ CODA_OSS_disable_warning_pop #pragma warning(disable: 6387) // '...' could be '...'. #pragma warning(disable: 6305) // Potential mismatch between sizeof and countof quantities. Use sizeof() to scale byte sizes. #pragma warning(disable: 6389) // Move '...' to anonymous namespace or put a forward declaration in a common header included in this file. +#pragma warning(disable: 4866) // compiler may not enforce left-to-right evaluation order for call to '...' #pragma warning(disable: 26822) // Dereferencing a null pointer '...' (lifetime.1). #pragma warning(disable: 26432) // If you define or delete any default operation in the type '...', define or delete them all (c.21). diff --git a/externals/coda-oss/modules/c++/std/include/std/cstddef b/externals/coda-oss/modules/c++/std/include/std/cstddef index 10ba7deac1..794d21efb6 100644 --- a/externals/coda-oss/modules/c++/std/include/std/cstddef +++ b/externals/coda-oss/modules/c++/std/include/std/cstddef @@ -18,33 +18,10 @@ * License along with this program; If not, http://www.gnu.org/licenses/. * */ +#pragma once #ifndef CODA_OSS_std_cstddef_INCLUDED_ #define CODA_OSS_std_cstddef_INCLUDED_ -#pragma once - -#include #include -#include -#include "coda_oss/cstddef.h" -#include "coda_oss/CPlusPlus.h" - -// Make it (too?) easy for clients to get our various std:: implementations -#ifndef CODA_OSS_NO_std_byte - #if defined(__cpp_lib_byte) && (__cpp_lib_byte >= 201603L) // https://en.cppreference.com/w/cpp/utility/feature_test - #undef CODA_OSS_NO_std_byte - #define CODA_OSS_NO_std_byte 1 // provided by implementation, probably C++20 - #else - #define CODA_OSS_NO_std_byte 0 // use our own - #endif -#endif - -#if !CODA_OSS_NO_std_byte -namespace std // This is slightly uncouth: we're not supposed to augment "std". -{ - using coda_oss::byte; -} -static_assert(!std::is_same::value, "'std::byte' should be a unique type."); -#endif // !CODA_OSS_NO_std_byte #endif // CODA_OSS_std_cstddef_INCLUDED_ \ No newline at end of file diff --git a/externals/coda-oss/modules/c++/std/include/std/type_traits b/externals/coda-oss/modules/c++/std/include/std/type_traits index 1aba653f96..cbcd0bfd8a 100644 --- a/externals/coda-oss/modules/c++/std/include/std/type_traits +++ b/externals/coda-oss/modules/c++/std/include/std/type_traits @@ -18,30 +18,11 @@ * License along with this program; If not, http://www.gnu.org/licenses/. * */ +#pragma once #ifndef CODA_OSS_std_type_traits_INCLUDED_ #define CODA_OSS_std_type_traits_INCLUDED_ -#pragma once #include -#include "coda_oss/type_traits.h" - -// Make it (too?) easy for clients to get our various std:: implementations -#ifndef CODA_OSS_NO_is_trivially_copyable - // https://stackoverflow.com/a/31798726/8877 - // workaround missing "is_trivially_copyable" in g++ < 5.0 - #if defined(__GNUC__) && (__GNUC__ < 5) - #define CODA_OSS_NO_is_trivially_copyable 0 // *need* our own - #else - #define CODA_OSS_NO_is_trivially_copyable 1 // *disabled*, unless explicitly enabled - #endif -#endif - -#if !CODA_OSS_NO_is_trivially_copyable -namespace std // This is slightly uncouth: we're not supposed to augment "std". -{ - using coda_oss::is_trivially_copyable; -} -#endif // CODA_OSS_NO_is_trivially_copyable #endif // CODA_OSS_std_type_traits_INCLUDED_ diff --git a/externals/coda-oss/modules/c++/str/include/str/Manip.h b/externals/coda-oss/modules/c++/str/include/str/Manip.h index 0b48673a5a..ee95a4663a 100644 --- a/externals/coda-oss/modules/c++/str/include/str/Manip.h +++ b/externals/coda-oss/modules/c++/str/include/str/Manip.h @@ -46,16 +46,7 @@ CODA_OSS_disable_warning_push template inline CharT* data(std::basic_string& s) noexcept { - #if CODA_OSS_cpp17 return s.data(); - #else - CODA_OSS_disable_warning_push - #if _MSC_VER - #pragma warning(disable : 26492) // Don't use const_cast to cast away const or volatile (type.3). - #endif - return const_cast ::pointer>(s.data()); - CODA_OSS_disable_warning_pop - #endif // CODA_OSS_cpp17 } CODA_OSS_disable_warning_pop template diff --git a/modules/c++/nitf-c++.vcxproj b/modules/c++/nitf-c++.vcxproj index bb2e908281..e64ce3f977 100644 --- a/modules/c++/nitf-c++.vcxproj +++ b/modules/c++/nitf-c++.vcxproj @@ -234,6 +234,9 @@ true MultiThreadedDebugDLL true + stdcpp17 + stdc11 + true @@ -263,6 +266,9 @@ Level3 AdvancedVectorExtensions2 true + stdcpp17 + stdc11 + true diff --git a/modules/c++/nitf/apps/show_nitf++/show_nitf++.vcxproj b/modules/c++/nitf/apps/show_nitf++/show_nitf++.vcxproj index 7e93ad84ad..cd7d97dcc0 100644 --- a/modules/c++/nitf/apps/show_nitf++/show_nitf++.vcxproj +++ b/modules/c++/nitf/apps/show_nitf++/show_nitf++.vcxproj @@ -66,6 +66,9 @@ AdvancedVectorExtensions2 true true + stdcpp17 + stdc11 + true Console @@ -91,6 +94,9 @@ Level3 AdvancedVectorExtensions2 true + stdcpp17 + stdc11 + true Console diff --git a/modules/c++/nitf/include/nitf/SubWindow.hpp b/modules/c++/nitf/include/nitf/SubWindow.hpp index 241cf7513e..1cf3c1c572 100644 --- a/modules/c++/nitf/include/nitf/SubWindow.hpp +++ b/modules/c++/nitf/include/nitf/SubWindow.hpp @@ -119,18 +119,12 @@ DECLARE_CLASS(SubWindow) std::optional> bandList; }; -#if CODA_OSS_cpp14 // This template