Skip to content

Commit

Permalink
Merge branch 'main' into cpp17
Browse files Browse the repository at this point in the history
  • Loading branch information
Dan Smith committed Nov 29, 2023
2 parents 99845f0 + 953e132 commit f0fc238
Show file tree
Hide file tree
Showing 233 changed files with 1,771 additions and 848 deletions.
21 changes: 17 additions & 4 deletions UnitTest/UnitTest.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,7 @@
<WarningLevel>Level4</WarningLevel>
<SDLCheck>true</SDLCheck>
<AdditionalIncludeDirectories>$(SolutionDir);$(SolutionDir)six\modules\c++\scene\include;$(SolutionDir)six\modules\c++\six\include;$(SolutionDir)six\modules\c++\six.sidd\include;$(SolutionDir)six\modules\c++\six.sicd\include;$(SolutionDir)six\modules\c++\cphd\include;$(SolutionDir)six\modules\c++\cphd03\include;$(SolutionDir)externals\nitro\modules\c\nrt\include;$(SolutionDir)externals\nitro\modules\c\nitf\include;$(SolutionDir)externals\nitro\modules\c++\nitf\include;$(SolutionDir)externals\coda-oss\out\install\$(Platform)-$(Configuration)\include;$(SolutionDir)externals\coda-oss\out\install\$(Platform)-$(Configuration);$(SolutionDir)out\install\$(Platform)-$(Configuration)\include;$(SolutionDir)out\install\$(Platform)-$(Configuration);$(VCInstallDir)UnitTest\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_DEBUG;SIX_DEFAULT_SCHEMA_PATH=R"($(SolutionDir)install-$(Configuration)-$(Platform).$(PlatformToolset)\conf\schema\six)";%(PreprocessorDefinitions);_SILENCE_NONFLOATING_COMPLEX_DEPRECATION_WARNING</PreprocessorDefinitions>
<UseFullPaths>true</UseFullPaths>
<PreprocessorDefinitions>_DEBUG;SIX_DEFAULT_SCHEMA_PATH=R"($(SolutionDir)install-$(Configuration)-$(Platform).$(PlatformToolset)\conf\schema\six)";%(PreprocessorDefinitions);_SILENCE_NONFLOATING_COMPLEX_DEPRECATION_WARNING; CODA_OSS_LIBRARY_SHARED</PreprocessorDefinitions>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<EnableEnhancedInstructionSet>AdvancedVectorExtensions2</EnableEnhancedInstructionSet>
Expand All @@ -86,8 +85,7 @@
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<AdditionalIncludeDirectories>$(SolutionDir);$(SolutionDir)six\modules\c++\scene\include;$(SolutionDir)six\modules\c++\six\include;$(SolutionDir)six\modules\c++\six.sidd\include;$(SolutionDir)six\modules\c++\six.sicd\include;$(SolutionDir)six\modules\c++\cphd\include;$(SolutionDir)six\modules\c++\cphd03\include;$(SolutionDir)externals\nitro\modules\c\nrt\include;$(SolutionDir)externals\nitro\modules\c\nitf\include;$(SolutionDir)externals\nitro\modules\c++\nitf\include;$(SolutionDir)externals\coda-oss\out\install\$(Platform)-$(Configuration)\include;$(SolutionDir)externals\coda-oss\out\install\$(Platform)-$(Configuration);$(SolutionDir)out\install\$(Platform)-$(Configuration)\include;$(SolutionDir)out\install\$(Platform)-$(Configuration);$(VCInstallDir)UnitTest\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions);_SILENCE_NONFLOATING_COMPLEX_DEPRECATION_WARNING</PreprocessorDefinitions>
<UseFullPaths>true</UseFullPaths>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions);_SILENCE_NONFLOATING_COMPLEX_DEPRECATION_WARNING; CODA_OSS_LIBRARY_SHARED</PreprocessorDefinitions>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<EnableEnhancedInstructionSet>AdvancedVectorExtensions2</EnableEnhancedInstructionSet>
Expand Down Expand Up @@ -298,12 +296,27 @@
<ClInclude Include="TestCase.h" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\externals\coda-oss\modules\c++\coda-oss.vcxproj">
<Project>{9997e895-5161-4ddf-8f3f-099894cb2f21}</Project>
</ProjectReference>
<ProjectReference Include="..\externals\nitro\modules\c++\nitf-c++.vcxproj">
<Project>{8f357a19-799e-4971-850e-3f28485c130b}</Project>
</ProjectReference>
<ProjectReference Include="..\externals\nitro\modules\c\nitf-c.vcxproj">
<Project>{f06550ad-cfc7-40b8-8727-6c82c69a8982}</Project>
</ProjectReference>
<ProjectReference Include="..\externals\nitro\modules\c\nitf\XML_DATA_CONTENT.vcxproj">
<Project>{78849481-d356-4cc7-b182-31c21f857ed1}</Project>
</ProjectReference>
<ProjectReference Include="..\six\modules\c++\cphd03\cphd03.vcxproj">
<Project>{016ef417-e41c-404c-b3b5-34b6cdd94bb3}</Project>
</ProjectReference>
<ProjectReference Include="..\six\modules\c++\cphd\cphd.vcxproj">
<Project>{01be4480-9620-4ded-b34f-d2e3ab4b7c8b}</Project>
</ProjectReference>
<ProjectReference Include="..\six\modules\c++\scene\scene.vcxproj">
<Project>{1cfcde59-6410-4037-95eb-b37d31e10820}</Project>
</ProjectReference>
<ProjectReference Include="..\six\modules\c++\six.sicd\six.sicd.vcxproj">
<Project>{34ac2314-fbd1-42ad-aaf4-0cebc6bf737e}</Project>
</ProjectReference>
Expand Down
10 changes: 2 additions & 8 deletions UnitTest/pch.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,17 +82,11 @@
#include <import/cphd03.h>

#pragma comment(lib, "ws2_32")
#pragma comment(lib, "mt-c++")
#pragma comment(lib, "sys-c++")
#pragma comment(lib, "except-c++")
#pragma comment(lib, "str-c++")
#pragma comment(lib, "xerces-c")
#pragma comment(lib, "xml.lite-c++.lib")

#pragma warning(push)
#pragma warning(disable: 4800) // Implicit conversion from '...' to bool.Possible information loss
#pragma warning(disable: 4800) // Implicit conversion from '...' to bool. Possible information loss
#pragma warning(disable: 4388) // '...': signed / unsigned mismatch
#pragma warning(disable: 4866) // compiler may not enforce left - to - right evaluation order for call to '...'
#pragma warning(disable: 4866) // compiler may not enforce left-to-right evaluation order for call to '...'

#include "CppUnitTest.h"
#pragma warning(pop)
Expand Down
4 changes: 4 additions & 0 deletions externals/coda-oss/cmake/CodaBuild.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,12 @@ macro(coda_initialize_build)
option(BUILD_SHARED_LIBS "Build shared libraries instead of static." OFF)
if(BUILD_SHARED_LIBS)
set(CODA_LIBRARY_TYPE "shared")
add_definitions(-DCODA_OSS_LIBRARY_SHARED=1)
add_definitions(-UCODA_OSS_LIBRARY_STATIC)
else()
set(CODA_LIBRARY_TYPE "static")
add_definitions(-DCODA_OSS_LIBRARY_STATIC=1)
add_definitions(-UCODA_OSS_LIBRARY_SHARED)
endif()

option(CODA_BUILD_TESTS "build tests" ON)
Expand Down
5 changes: 3 additions & 2 deletions externals/coda-oss/modules/c++/coda-oss.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,7 @@
<ClCompile>
<WarningLevel>Level4</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_DEBUG;_LIB;%(PreprocessorDefinitions);CODA_OSS_EXPORTS;CODA_OSS_DLL;MT_DEFAULT_PINNING=0;RE_ENABLE_STD_REGEX=1</PreprocessorDefinitions>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions);MT_DEFAULT_PINNING=0;RE_ENABLE_STD_REGEX=1;CODA_OSS_EXPORTS;CODA_OSS_LIBRARY_SHARED=1</PreprocessorDefinitions>
<ForcedIncludeFiles>pch.h</ForcedIncludeFiles>
<AdditionalIncludeDirectories>cli\include;coda_oss\include;config\include;dbi\include;except\include;gsl\include;hdf5.lite\include;io\include;logging\include;math\include;math.linear\include;math.poly\include;mem\include;mt\include;net\include;net.ssl\include;plugin\include;polygon\include;re\include;sio.lite\include;std\include;str\include;sys\include;tiff\include;types\include;unique\include;units\include;xml.lite\include;zip\include;$(ProjectDir)include;$(SolutionDir)out\install\$(Platform)-$(Configuration)\include;$(SolutionDir)externals\$(ProjectName)\out\install\$(Platform)-$(Configuration)\include</AdditionalIncludeDirectories>
<PrecompiledHeader>Use</PrecompiledHeader>
Expand Down Expand Up @@ -601,7 +601,7 @@
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>NDEBUG;_LIB;%(PreprocessorDefinitions);CODA_OSS_EXPORTS;CODA_OSS_DLL;MT_DEFAULT_PINNING=0;RE_ENABLE_STD_REGEX=1</PreprocessorDefinitions>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions);MT_DEFAULT_PINNING=0;RE_ENABLE_STD_REGEX=1;CODA_OSS_EXPORTS;CODA_OSS_LIBRARY_SHARED=1</PreprocessorDefinitions>
<ForcedIncludeFiles>pch.h</ForcedIncludeFiles>
<AdditionalIncludeDirectories>cli\include;coda_oss\include;config\include;dbi\include;except\include;gsl\include;hdf5.lite\include;io\include;logging\include;math\include;math.linear\include;math.poly\include;mem\include;mt\include;net\include;net.ssl\include;plugin\include;polygon\include;re\include;sio.lite\include;std\include;str\include;sys\include;tiff\include;types\include;unique\include;units\include;xml.lite\include;zip\include;$(ProjectDir)include;$(SolutionDir)out\install\$(Platform)-$(Configuration)\include;$(SolutionDir)externals\$(ProjectName)\out\install\$(Platform)-$(Configuration)\include</AdditionalIncludeDirectories>
<PrecompiledHeader>Use</PrecompiledHeader>
Expand All @@ -617,6 +617,7 @@
<LanguageStandard_C>stdc11</LanguageStandard_C>
<UseStandardPreprocessor>true</UseStandardPreprocessor>
<WarningLevel>Level3</WarningLevel>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
</ClCompile>
<Link>
<SubSystem>
Expand Down
34 changes: 20 additions & 14 deletions externals/coda-oss/modules/c++/config/include/config/Exports.h
Original file line number Diff line number Diff line change
@@ -1,22 +1,30 @@
#ifndef CODA_OSS_config_Exports_h_INCLUDED_
#define CODA_OSS_config_Exports_h_INCLUDED_
#pragma once

#include "config/compiler_extensions.h"

// Need to specify how this code will be consumed, either CODA_OSS_LIB (static library)
// or CODA_OSS_DLL (aka "shared" library). For DLLs, it needs to be set for BOTH
// Need to specify how this code will be consumed, either CODA_OSS_LIB_ (static library)
// or CODA_OSS_DLL_ (aka "shared" library). For DLLs, it needs to be set for BOTH
// "exporting" (building this code) and "importing" (consuming).
//
// Use Windows naming conventions (DLL, LIB) because this really only matters for _MSC_VER, see below.
#if !defined(CODA_OSS_LIB) && !defined(CODA_OSS_DLL)
#define CODA_OSS_LIB 1
//#define CODA_OSS_DLL 1
#if !defined(CODA_OSS_LIB_) && !defined(CODA_OSS_DLL_)
#if CODA_OSS_LIBRARY_SHARED
#if CODA_OSS_LIBRARY_STATIC
#error "CODA_OSS_LIBRARY_SHARED already #define'd'"
#endif
#define CODA_OSS_DLL_ 1 // Symbols must be exported and imported (see below).
#else
// CODA_OSS_LIBRARY_STATIC doesn't have to be defined
#define CODA_OSS_LIB_ 1 // Static library, all symbols visible.
#endif
#endif
#if defined(CODA_OSS_LIB) && defined(CODA_OSS_DLL)
#error "Both CODA_OSS_LIB and CODA_OSS_DLL are #define'd'"
#if !defined(CODA_OSS_LIB_) && !defined(CODA_OSS_DLL_)
#error "One of CODA_OSS_LIB_ pr CODA_OSS_DLL_ must be #define'd'"
#endif
#if defined(CODA_OSS_EXPORTS) && defined(CODA_OSS_LIB)
#if defined(CODA_OSS_LIB_) && defined(CODA_OSS_DLL_)
#error "Both CODA_OSS_LIB_ and CODA_OSS_DLL_ are #define'd'"
#endif
#if defined(CODA_OSS_EXPORTS) && defined(CODA_OSS_LIB_)
#error "Can't export from a LIB'"
#endif

Expand All @@ -35,10 +43,10 @@

// We need to know whether we're consuming (importing) a DLL or static LIB
// The default is a static LIB as that's what existing code/builds expect.
#ifdef CODA_OSS_DLL
#ifdef CODA_OSS_DLL_
// Actually, it seems that the linker is able to figure this out from the .LIB, so
// there doesn't seem to be a need for __declspec(dllimport). Clients don't
// need to #define CODA_OSS_DLL ... ? Well, almost ... it looks
// need to #define CODA_OSS_DLL_ ... ? Well, almost ... it looks
// like __declspec(dllimport) is needed to get virtual "inline"s (e.g.,
// destructors) correct.
#define CODA_OSS_API CODA_OSS_library_import
Expand All @@ -50,5 +58,3 @@
#if defined(_MSC_VER)
#pragma warning(disable: 4251) // '...' : class '...' needs to have dll-interface to be used by clients of struct '...'
#endif

#endif // CODA_OSS_config_Exports_h_INCLUDED_
6 changes: 4 additions & 2 deletions externals/coda-oss/modules/c++/io/include/io/Serializable.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@
* see <http://www.gnu.org/licenses/>.
*
*/

#pragma once
#ifndef __IO_SERIALIZABLE_H__
#define __IO_SERIALIZABLE_H__

#include "config/Exports.h"

#include "io/InputStream.h"
#include "io/OutputStream.h"

Expand All @@ -46,7 +48,7 @@ namespace io
* This object has a known derived type SOAPMessage, which is concretely
* defined to handle SOAP objects
*/
struct Serializable
struct CODA_OSS_API Serializable
{
Serializable() = default;
virtual ~Serializable() noexcept(false) {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
*
*/

#pragma once
#ifndef CODA_OSS_logging_Setup_h_INCLUDED_
#define CODA_OSS_logging_Setup_h_INCLUDED_

Expand All @@ -29,6 +30,7 @@
#include "mem/SharedPtr.h"
#include "logging/Logger.h"
#include "sys/filesystem.h"
#include "config/Exports.h"

namespace logging
{
Expand All @@ -48,7 +50,7 @@ using path = coda_oss::filesystem::path; // still used in SWIG bindings
* \param logCount - number of rotating logs to keep (default: 0 no rotation)
* \param logBytes - number of bytes per rotating log (default: 0 no rotation)
*/
std::unique_ptr<logging::Logger> setupLogger(
CODA_OSS_API std::unique_ptr<logging::Logger> setupLogger(
const path& program,
const std::string& logLevel = "warning",
const path& logFile = "console",
Expand Down
10 changes: 7 additions & 3 deletions externals/coda-oss/modules/c++/pch.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,13 @@
// Do not add files here that you will be updating frequently as this negates the performance advantage.

#pragma once
#ifndef CODA_OSS_pch_h_INCLUDED_
#define CODA_OSS_pch_h_INCLUDED_

// We're building in Visual Studio ... used to control where we get a little bit
// of config info
#define CODA_OSS_PCH 1
#ifndef CODA_OSS_LIBRARY_SHARED
#define CODA_OSS_LIBRARY_SHARED 1
#endif

#include "coda_oss/CPlusPlus.h"
#include "config/disable_compiler_warnings.h"
Expand Down Expand Up @@ -114,4 +119,3 @@ CODA_OSS_disable_warning_pop
#include "hdf5/lite/H5_.h"
#pragma comment(lib, "hdf5-c++.lib")

#endif //CODA_OSS_pch_h_INCLUDED_
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,19 @@
* see <http://www.gnu.org/licenses/>.
*
*/

#pragma once
#ifndef __PLUGIN_ERROR_HANDLER_H__
#define __PLUGIN_ERROR_HANDLER_H__

#include <import/except.h>
#include <import/sys.h>
#include <import/logging.h>

#include "config/Exports.h"

namespace plugin
{
class ErrorHandler
class CODA_OSS_API ErrorHandler
{
public:
ErrorHandler() {}
Expand All @@ -47,7 +49,7 @@ class ErrorHandler
virtual void onPluginError(except::Context& c) = 0;
};

class DefaultErrorHandler : public ErrorHandler
class CODA_OSS_API DefaultErrorHandler final : public ErrorHandler
{
public:
DefaultErrorHandler(logging::LoggerPtr logger = logging::LoggerPtr());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
* see <http://www.gnu.org/licenses/>.
*
*/
#pragma once
#ifndef __SIO_LITE_FILE_HEADER_H__
#define __SIO_LITE_FILE_HEADER_H__

Expand All @@ -28,6 +29,7 @@
#include <import/except.h>
#include <import/sys.h>
#include <import/io.h>
#include "config/Exports.h"
#include "sio/lite/UserDataDictionary.h"
#include "sio/lite/InvalidHeaderException.h"
#include "sio/lite/UnsupportedDataTypeException.h"
Expand All @@ -37,7 +39,7 @@ namespace sio
namespace lite
{

class FileHeader
class CODA_OSS_API FileHeader
{
public:
/** Unsigned byte data */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@
* see <http://www.gnu.org/licenses/>.
*
*/
#ifndef CODA_OSS_sio_lite_FileReader_h_INCLUDED_
#define CODA_OSS_sio_lite_FileReader_h_INCLUDED_
#pragma once

#include "sio/lite/SioFileReader.h"

#endif // CODA_OSS_sio_lite_FileReader_h_INCLUDED_
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,14 @@
* see <http://www.gnu.org/licenses/>.
*
*/
#pragma once
#ifndef __SIO_LITE_FILE_READER_H__
#define __SIO_LITE_FILE_READER_H__

#include <import/sys.h>
#include <io/Seekable.h>
#include <io/FileInputStream.h>
#include "config/Exports.h"
#include "sio/lite/InvalidHeaderException.h"
#include "sio/lite/StreamReader.h"

Expand Down Expand Up @@ -80,12 +82,9 @@ namespace lite
\endcode
*/

class FileReader : public StreamReader, public io::Seekable
class CODA_OSS_API FileReader : public StreamReader, public io::Seekable
{


public:

/** Constructor */
FileReader() : StreamReader() {}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@
* see <http://www.gnu.org/licenses/>.
*
*/
#pragma once
#ifndef __SIO_LITE_STREAM_READER_H__
#define __SIO_LITE_STREAM_READER_H__

#include <io/InputStream.h>
#include "config/Exports.h"
#include "sio/lite/FileHeader.h"

namespace sio
Expand Down Expand Up @@ -87,7 +89,7 @@ namespace lite
\endcode
*
*/
class StreamReader : public io::InputStream
class CODA_OSS_API StreamReader : public io::InputStream
{
public:
/** Constructor */
Expand Down
5 changes: 3 additions & 2 deletions externals/coda-oss/modules/c++/sys/include/sys/DLL.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
*
*/


#pragma once
#ifndef __SYS_DLL_H__
#define __SYS_DLL_H__

Expand Down Expand Up @@ -52,6 +52,7 @@ typedef void* DLL_FUNCTION_PTR;

#include "except/Exception.h"
#include "sys/Err.h"
#include "config/Exports.h"


namespace sys
Expand Down Expand Up @@ -124,7 +125,7 @@ struct DLLException : public except::Exception
*/


struct DLL
struct CODA_OSS_API DLL
{
/*!
* Construct a library object, but dont populate or load it
Expand Down
Loading

0 comments on commit f0fc238

Please sign in to comment.