From 5ce3b6e4f57858205b377f2f5b59b1c24aa1ad9d Mon Sep 17 00:00:00 2001 From: Dan Smith Date: Wed, 29 Nov 2023 16:04:27 -0500 Subject: [PATCH] Squashed 'externals/coda-oss/' changes from cf6c4249a..aba8366d8 aba8366d8 CODA_OSS_LIBRARY_SHARED=1 52e067ec7 Merge branch 'main' into cpp17 df4e0fc1f changes to build SIX DLLs (#757) faf5d0521 allow CMake to switch between building SHARED (DLLs) or STATIC libraires d15173f38 export symbols used by NITRO (#756) 6ed3c048b use Debug DLL library in Debug git-subtree-dir: externals/coda-oss git-subtree-split: aba8366d8b11467d9986344c68947c04748e5911 --- UnitTest/UnitTest.vcxproj | 4 +-- cmake/CodaBuild.cmake | 4 +++ modules/c++/coda-oss.vcxproj | 5 +-- modules/c++/config/include/config/Exports.h | 34 +++++++++++-------- modules/c++/io/include/io/Serializable.h | 6 ++-- modules/c++/logging/include/logging/Setup.h | 4 ++- modules/c++/pch.h | 10 ++++-- .../c++/plugin/include/plugin/ErrorHandler.h | 8 +++-- .../sio.lite/include/sio/lite/FileHeader.h | 4 ++- .../sio.lite/include/sio/lite/FileReader.h | 4 --- .../sio.lite/include/sio/lite/SioFileReader.h | 7 ++-- .../sio.lite/include/sio/lite/StreamReader.h | 4 ++- modules/c++/sys/include/sys/DLL.h | 5 +-- modules/c++/sys/include/sys/FileFinder.h | 15 ++++---- modules/c++/sys/include/sys/sys_filesystem.h | 1 + modules/c++/tiff/include/tiff/FileReader.h | 2 +- modules/c++/tiff/include/tiff/FileWriter.h | 2 +- modules/c++/tiff/include/tiff/Header.h | 6 ++-- modules/c++/tiff/include/tiff/IFD.h | 6 ++-- modules/c++/tiff/include/tiff/IFDEntry.h | 10 +++--- modules/c++/tiff/include/tiff/ImageReader.h | 5 +-- modules/c++/tiff/include/tiff/ImageWriter.h | 5 +-- modules/c++/tiff/include/tiff/KnownTags.h | 22 ++++++------ .../c++/tiff/include/tiff/TiffFileReader.h | 6 ++-- .../c++/tiff/include/tiff/TiffFileWriter.h | 7 ++-- modules/c++/tiff/include/tiff/TypeFactory.h | 6 ++-- modules/c++/tiff/source/KnownTags.cpp | 8 ----- .../c++/xml.lite/include/xml/lite/Element.h | 2 +- 28 files changed, 115 insertions(+), 87 deletions(-) diff --git a/UnitTest/UnitTest.vcxproj b/UnitTest/UnitTest.vcxproj index a0585026c1..1a9ac64c70 100644 --- a/UnitTest/UnitTest.vcxproj +++ b/UnitTest/UnitTest.vcxproj @@ -58,7 +58,7 @@ Level4 true $(VCInstallDir)UnitTest\include;$(ProjectDir);$(SolutionDir)modules\c++;$(SolutionDir)modules\c++\avx\include;$(SolutionDir)modules\c++\cli\include;$(SolutionDir)modules\c++\config\include;$(SolutionDir)modules\c++\coda_oss\include;$(SolutionDir)modules\c++\gsl\include;$(SolutionDir)modules\c++\hdf5.lite\include;$(SolutionDir)modules\c++\io\include;$(SolutionDir)modules\c++\std\include;$(SolutionDir)modules\c++\str\include;$(SolutionDir)modules\c++\sys\include;$(SolutionDir)modules\c++\except\include;$(SolutionDir)modules\c++\logging\include;$(SolutionDir)modules\c++\math\include;$(SolutionDir)modules\c++\math.linear\include;$(SolutionDir)modules\c++\math.poly\include;$(SolutionDir)modules\c++\mem\include;$(SolutionDir)modules\c++\mt\include;$(SolutionDir)modules\c++\polygon\include;$(SolutionDir)modules\c++\re\include;$(SolutionDir)modules\c++\types\include;$(SolutionDir)modules\c++\units\include;$(SolutionDir)modules\c++\xml.lite\include;$(SolutionDir)modules\c++\zip\include;$(SolutionDir)modules\drivers;$(SolutionDir)out\install\$(Platform)-$(Configuration)\include;%(AdditionalIncludeDirectories) - _DEBUG;%(PreprocessorDefinitions);MT_DEFAULT_PINNING=0;RE_ENABLE_STD_REGEX=1 + _DEBUG;%(PreprocessorDefinitions);MT_DEFAULT_PINNING=0;RE_ENABLE_STD_REGEX=1;CODA_OSS_LIBRARY_SHARED=1 true pch.h true @@ -88,7 +88,7 @@ true true $(VCInstallDir)UnitTest\include;$(ProjectDir);$(SolutionDir)modules\c++;$(SolutionDir)modules\c++\avx\include;$(SolutionDir)modules\c++\cli\include;$(SolutionDir)modules\c++\config\include;$(SolutionDir)modules\c++\coda_oss\include;$(SolutionDir)modules\c++\gsl\include;$(SolutionDir)modules\c++\hdf5.lite\include;$(SolutionDir)modules\c++\io\include;$(SolutionDir)modules\c++\std\include;$(SolutionDir)modules\c++\str\include;$(SolutionDir)modules\c++\sys\include;$(SolutionDir)modules\c++\except\include;$(SolutionDir)modules\c++\logging\include;$(SolutionDir)modules\c++\math\include;$(SolutionDir)modules\c++\math.linear\include;$(SolutionDir)modules\c++\math.poly\include;$(SolutionDir)modules\c++\mem\include;$(SolutionDir)modules\c++\mt\include;$(SolutionDir)modules\c++\polygon\include;$(SolutionDir)modules\c++\re\include;$(SolutionDir)modules\c++\types\include;$(SolutionDir)modules\c++\units\include;$(SolutionDir)modules\c++\xml.lite\include;$(SolutionDir)modules\c++\zip\include;$(SolutionDir)modules\drivers;$(SolutionDir)out\install\$(Platform)-$(Configuration)\include;%(AdditionalIncludeDirectories) - NDEBUG;%(PreprocessorDefinitions);MT_DEFAULT_PINNING=0;RE_ENABLE_STD_REGEX=1 + NDEBUG;%(PreprocessorDefinitions);MT_DEFAULT_PINNING=0;RE_ENABLE_STD_REGEX=1;CODA_OSS_LIBRARY_SHARED=1 true pch.h true diff --git a/cmake/CodaBuild.cmake b/cmake/CodaBuild.cmake index ca1c3961b3..c4c859da6e 100644 --- a/cmake/CodaBuild.cmake +++ b/cmake/CodaBuild.cmake @@ -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) diff --git a/modules/c++/coda-oss.vcxproj b/modules/c++/coda-oss.vcxproj index 1199fd0d6f..585e654557 100644 --- a/modules/c++/coda-oss.vcxproj +++ b/modules/c++/coda-oss.vcxproj @@ -568,7 +568,7 @@ Level4 true - _DEBUG;_LIB;%(PreprocessorDefinitions);CODA_OSS_EXPORTS;CODA_OSS_DLL;MT_DEFAULT_PINNING=0;RE_ENABLE_STD_REGEX=1 + _DEBUG;%(PreprocessorDefinitions);MT_DEFAULT_PINNING=0;RE_ENABLE_STD_REGEX=1;CODA_OSS_EXPORTS;CODA_OSS_LIBRARY_SHARED=1 pch.h 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 Use @@ -601,7 +601,7 @@ true true true - NDEBUG;_LIB;%(PreprocessorDefinitions);CODA_OSS_EXPORTS;CODA_OSS_DLL;MT_DEFAULT_PINNING=0;RE_ENABLE_STD_REGEX=1 + NDEBUG;%(PreprocessorDefinitions);MT_DEFAULT_PINNING=0;RE_ENABLE_STD_REGEX=1;CODA_OSS_EXPORTS;CODA_OSS_LIBRARY_SHARED=1 pch.h 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 Use @@ -617,6 +617,7 @@ stdc11 true Level3 + Speed diff --git a/modules/c++/config/include/config/Exports.h b/modules/c++/config/include/config/Exports.h index 6b77d9fd74..71949e7c7b 100644 --- a/modules/c++/config/include/config/Exports.h +++ b/modules/c++/config/include/config/Exports.h @@ -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 @@ -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 @@ -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_ diff --git a/modules/c++/io/include/io/Serializable.h b/modules/c++/io/include/io/Serializable.h index e6d2363ae1..4db6eeab7e 100644 --- a/modules/c++/io/include/io/Serializable.h +++ b/modules/c++/io/include/io/Serializable.h @@ -19,10 +19,12 @@ * see . * */ - +#pragma once #ifndef __IO_SERIALIZABLE_H__ #define __IO_SERIALIZABLE_H__ +#include "config/Exports.h" + #include "io/InputStream.h" #include "io/OutputStream.h" @@ -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) {} diff --git a/modules/c++/logging/include/logging/Setup.h b/modules/c++/logging/include/logging/Setup.h index ed6334d6e4..763767a49f 100644 --- a/modules/c++/logging/include/logging/Setup.h +++ b/modules/c++/logging/include/logging/Setup.h @@ -20,6 +20,7 @@ * */ +#pragma once #ifndef CODA_OSS_logging_Setup_h_INCLUDED_ #define CODA_OSS_logging_Setup_h_INCLUDED_ @@ -29,6 +30,7 @@ #include "mem/SharedPtr.h" #include "logging/Logger.h" #include "sys/filesystem.h" +#include "config/Exports.h" namespace logging { @@ -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 setupLogger( +CODA_OSS_API std::unique_ptr setupLogger( const path& program, const std::string& logLevel = "warning", const path& logFile = "console", diff --git a/modules/c++/pch.h b/modules/c++/pch.h index 7952e6efa2..5cda65986c 100644 --- a/modules/c++/pch.h +++ b/modules/c++/pch.h @@ -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" @@ -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_ diff --git a/modules/c++/plugin/include/plugin/ErrorHandler.h b/modules/c++/plugin/include/plugin/ErrorHandler.h index be7ca3c8a8..234e6c5a18 100644 --- a/modules/c++/plugin/include/plugin/ErrorHandler.h +++ b/modules/c++/plugin/include/plugin/ErrorHandler.h @@ -19,7 +19,7 @@ * see . * */ - +#pragma once #ifndef __PLUGIN_ERROR_HANDLER_H__ #define __PLUGIN_ERROR_HANDLER_H__ @@ -27,9 +27,11 @@ #include #include +#include "config/Exports.h" + namespace plugin { -class ErrorHandler +class CODA_OSS_API ErrorHandler { public: ErrorHandler() {} @@ -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()); diff --git a/modules/c++/sio.lite/include/sio/lite/FileHeader.h b/modules/c++/sio.lite/include/sio/lite/FileHeader.h index a5633e5098..1a76c16764 100644 --- a/modules/c++/sio.lite/include/sio/lite/FileHeader.h +++ b/modules/c++/sio.lite/include/sio/lite/FileHeader.h @@ -19,6 +19,7 @@ * see . * */ +#pragma once #ifndef __SIO_LITE_FILE_HEADER_H__ #define __SIO_LITE_FILE_HEADER_H__ @@ -28,6 +29,7 @@ #include #include #include +#include "config/Exports.h" #include "sio/lite/UserDataDictionary.h" #include "sio/lite/InvalidHeaderException.h" #include "sio/lite/UnsupportedDataTypeException.h" @@ -37,7 +39,7 @@ namespace sio namespace lite { -class FileHeader +class CODA_OSS_API FileHeader { public: /** Unsigned byte data */ diff --git a/modules/c++/sio.lite/include/sio/lite/FileReader.h b/modules/c++/sio.lite/include/sio/lite/FileReader.h index b94fbc1ae7..885b3b68b6 100644 --- a/modules/c++/sio.lite/include/sio/lite/FileReader.h +++ b/modules/c++/sio.lite/include/sio/lite/FileReader.h @@ -19,10 +19,6 @@ * see . * */ -#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_ diff --git a/modules/c++/sio.lite/include/sio/lite/SioFileReader.h b/modules/c++/sio.lite/include/sio/lite/SioFileReader.h index 446476dfc7..54fe31c32f 100644 --- a/modules/c++/sio.lite/include/sio/lite/SioFileReader.h +++ b/modules/c++/sio.lite/include/sio/lite/SioFileReader.h @@ -19,12 +19,14 @@ * see . * */ +#pragma once #ifndef __SIO_LITE_FILE_READER_H__ #define __SIO_LITE_FILE_READER_H__ #include #include #include +#include "config/Exports.h" #include "sio/lite/InvalidHeaderException.h" #include "sio/lite/StreamReader.h" @@ -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() {} diff --git a/modules/c++/sio.lite/include/sio/lite/StreamReader.h b/modules/c++/sio.lite/include/sio/lite/StreamReader.h index 982b8900fb..efa9897ffc 100644 --- a/modules/c++/sio.lite/include/sio/lite/StreamReader.h +++ b/modules/c++/sio.lite/include/sio/lite/StreamReader.h @@ -19,10 +19,12 @@ * see . * */ +#pragma once #ifndef __SIO_LITE_STREAM_READER_H__ #define __SIO_LITE_STREAM_READER_H__ #include +#include "config/Exports.h" #include "sio/lite/FileHeader.h" namespace sio @@ -87,7 +89,7 @@ namespace lite \endcode * */ -class StreamReader : public io::InputStream +class CODA_OSS_API StreamReader : public io::InputStream { public: /** Constructor */ diff --git a/modules/c++/sys/include/sys/DLL.h b/modules/c++/sys/include/sys/DLL.h index 28fbb6be54..c384a461b8 100644 --- a/modules/c++/sys/include/sys/DLL.h +++ b/modules/c++/sys/include/sys/DLL.h @@ -20,7 +20,7 @@ * */ - +#pragma once #ifndef __SYS_DLL_H__ #define __SYS_DLL_H__ @@ -52,6 +52,7 @@ typedef void* DLL_FUNCTION_PTR; #include "except/Exception.h" #include "sys/Err.h" +#include "config/Exports.h" namespace sys @@ -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 diff --git a/modules/c++/sys/include/sys/FileFinder.h b/modules/c++/sys/include/sys/FileFinder.h index 0485de3c89..e60ec85534 100644 --- a/modules/c++/sys/include/sys/FileFinder.h +++ b/modules/c++/sys/include/sys/FileFinder.h @@ -20,6 +20,7 @@ * */ +#pragma once #ifndef __SYS_FILE_FINDER_H__ #define __SYS_FILE_FINDER_H__ @@ -37,7 +38,7 @@ namespace sys /** * Predicate interface for all entries */ -struct FilePredicate +struct CODA_OSS_API FilePredicate { using argument_type = std::string; using result_type = bool; @@ -58,7 +59,7 @@ struct ExistsPredicate : FilePredicate /** * Predicate that matches files only (no directories) */ -struct FileOnlyPredicate: public FilePredicate +struct CODA_OSS_API FileOnlyPredicate : public FilePredicate { virtual ~FileOnlyPredicate() = default; virtual bool operator()(const std::string& entry) const override; @@ -147,7 +148,7 @@ struct LogicalPredicate : public FilePredicate * The FileFinder class allows you to search for * files/directories in a clean way. */ -struct FileFinder final +struct CODA_OSS_API FileFinder final { FileFinder() = default; ~FileFinder() = default; @@ -167,7 +168,7 @@ struct FileFinder final // until either the file is found or we stop at a ".git" directory. // // This (obviously) might take a while, so consider whether the result should be cached. -coda_oss::filesystem::path findFirstFile(const coda_oss::filesystem::path& startingDirectory, const coda_oss::filesystem::path& filename); +CODA_OSS_API coda_oss::filesystem::path findFirstFile(const coda_oss::filesystem::path& startingDirectory, const coda_oss::filesystem::path& filename); coda_oss::filesystem::path findFirstDirectory(const coda_oss::filesystem::path& startingDirectory, const coda_oss::filesystem::path& dir); // This is here most to avoid creating a new module for a few utility routines @@ -175,11 +176,11 @@ namespace test // i.e., sys::test { // Try to find the specified "root" directory starting at the given path. // Used by unittest to find sample files. - coda_oss::filesystem::path findRootDirectory(const coda_oss::filesystem::path& p, const std::string& rootName, + CODA_OSS_API coda_oss::filesystem::path findRootDirectory(const coda_oss::filesystem::path& p, const std::string& rootName, std::function isRoot); - coda_oss::filesystem::path findCMakeBuildRoot(const coda_oss::filesystem::path& p); - bool isCMakeBuild(const coda_oss::filesystem::path& p); + CODA_OSS_API coda_oss::filesystem::path findCMakeBuildRoot(const coda_oss::filesystem::path& p); + bool CODA_OSS_API isCMakeBuild(const coda_oss::filesystem::path& p); coda_oss::filesystem::path findCMakeInstallRoot(const coda_oss::filesystem::path& p); bool isCMakeInstall(const coda_oss::filesystem::path& p); diff --git a/modules/c++/sys/include/sys/sys_filesystem.h b/modules/c++/sys/include/sys/sys_filesystem.h index 59df476a5d..3cbab0837e 100644 --- a/modules/c++/sys/include/sys/sys_filesystem.h +++ b/modules/c++/sys/include/sys/sys_filesystem.h @@ -79,6 +79,7 @@ struct CODA_OSS_API path final // N.B. this is an INCOMPLETE and NON-STANDARD im { *this = source; } + ~path() = default; path& operator=(const path&) = default; path& operator=(path&&) = default; diff --git a/modules/c++/tiff/include/tiff/FileReader.h b/modules/c++/tiff/include/tiff/FileReader.h index 88edb7c415..b80d508333 100644 --- a/modules/c++/tiff/include/tiff/FileReader.h +++ b/modules/c++/tiff/include/tiff/FileReader.h @@ -20,9 +20,9 @@ * */ +#pragma once #ifndef CODA_OSS_tiff_FileReader_h_INCLUDED_ #define CODA_OSS_tiff_FileReader_h_INCLUDED_ -#pragma once #include "tiff/TiffFileReader.h" diff --git a/modules/c++/tiff/include/tiff/FileWriter.h b/modules/c++/tiff/include/tiff/FileWriter.h index d77af0d6f7..e86b034530 100644 --- a/modules/c++/tiff/include/tiff/FileWriter.h +++ b/modules/c++/tiff/include/tiff/FileWriter.h @@ -20,9 +20,9 @@ * */ +#pragma once #ifndef CODA_OSS_tiff_FileWriter_h_INCLUDED_ #define CODA_OSS_tiff_FileWriter_h_INCLUDED_ -#pragma once #include "tiff/TiffFileWriter.h" diff --git a/modules/c++/tiff/include/tiff/Header.h b/modules/c++/tiff/include/tiff/Header.h index ed9da4f1e9..60b9e8b670 100644 --- a/modules/c++/tiff/include/tiff/Header.h +++ b/modules/c++/tiff/include/tiff/Header.h @@ -19,11 +19,13 @@ * see . * */ - +#pragma once #ifndef __TIFF_HEADER_H__ #define __TIFF_HEADER_H__ #include +#include + #include "tiff/Common.h" namespace tiff @@ -34,7 +36,7 @@ namespace tiff * @class Header * @brief Contains TIFF header information *********************************************************************/ -class Header : public io::Serializable +class CODA_OSS_API Header : public io::Serializable { public: enum ByteOrder { MM, II }; diff --git a/modules/c++/tiff/include/tiff/IFD.h b/modules/c++/tiff/include/tiff/IFD.h index 9120f581a5..ea5493db30 100644 --- a/modules/c++/tiff/include/tiff/IFD.h +++ b/modules/c++/tiff/include/tiff/IFD.h @@ -19,14 +19,16 @@ * see . * */ - +#pragma once #ifndef __TIFF_IFD_H__ #define __TIFF_IFD_H__ #include #include + #include #include +#include #include "tiff/IFDEntry.h" #include "tiff/KnownTags.h" @@ -45,7 +47,7 @@ namespace tiff * Contains functions for adding new entries to the IFD or adding * values to a specific IFD entry. *********************************************************************/ -class IFD : public io::Serializable +class CODA_OSS_API IFD : public io::Serializable { public: //! The IFDType diff --git a/modules/c++/tiff/include/tiff/IFDEntry.h b/modules/c++/tiff/include/tiff/IFDEntry.h index 75552676f3..e10285b996 100644 --- a/modules/c++/tiff/include/tiff/IFDEntry.h +++ b/modules/c++/tiff/include/tiff/IFDEntry.h @@ -20,17 +20,19 @@ * */ - +#pragma once #ifndef __TIFF_IFD_ENTRY_H__ #define __TIFF_IFD_ENTRY_H__ -#pragma once #include #include #include + #include -#include "tiff/GenericType.h" #include "sys/Conf.h" +#include "config/Exports.h" + +#include "tiff/GenericType.h" namespace tiff { @@ -47,7 +49,7 @@ namespace tiff * functions for printing out the entry, reading and writing it to a * file, and accessing the data. *********************************************************************/ -class IFDEntry : public io::Serializable +class CODA_OSS_API IFDEntry : public io::Serializable { public: //! Constructor diff --git a/modules/c++/tiff/include/tiff/ImageReader.h b/modules/c++/tiff/include/tiff/ImageReader.h index 65898ce700..5ca4354bf9 100644 --- a/modules/c++/tiff/include/tiff/ImageReader.h +++ b/modules/c++/tiff/include/tiff/ImageReader.h @@ -19,11 +19,12 @@ * see . * */ - +#pragma once #ifndef __TIFF_IMAGE_READER_H__ #define __TIFF_IMAGE_READER_H__ #include +#include #include "tiff/IFDEntry.h" #include "tiff/IFD.h" @@ -39,7 +40,7 @@ namespace tiff * Reads a TIFF image and parses out the IFD. Contains functions for * getting data from the image and retrieving the TIFF IFD. *********************************************************************/ -class ImageReader +class CODA_OSS_API ImageReader { public: /** diff --git a/modules/c++/tiff/include/tiff/ImageWriter.h b/modules/c++/tiff/include/tiff/ImageWriter.h index 412e291f92..cd4d7a3a2a 100644 --- a/modules/c++/tiff/include/tiff/ImageWriter.h +++ b/modules/c++/tiff/include/tiff/ImageWriter.h @@ -19,11 +19,12 @@ * see . * */ - +#pragma once #ifndef __TIFF_IMAGE_WRITER_H__ #define __TIFF_IMAGE_WRITER_H__ #include +#include #include "tiff/Common.h" #include "tiff/IFDEntry.h" @@ -40,7 +41,7 @@ namespace tiff * Writes a TIFF image to a stream. Contains functions for writing * the image's IFD, and for putting data to a stream. *********************************************************************/ -class ImageWriter +class CODA_OSS_API ImageWriter { public: //! The ideal tile size if a tiled file. diff --git a/modules/c++/tiff/include/tiff/KnownTags.h b/modules/c++/tiff/include/tiff/KnownTags.h index 75bd106563..c34779d03d 100644 --- a/modules/c++/tiff/include/tiff/KnownTags.h +++ b/modules/c++/tiff/include/tiff/KnownTags.h @@ -19,13 +19,14 @@ * see . * */ - +#pragma once #ifndef __TIFF_KNOWN_TAGS_H__ #define __TIFF_KNOWN_TAGS_H__ #include #include #include +#include #include "tiff/IFDEntry.h" @@ -35,10 +36,8 @@ namespace tiff /** * This class is a container for known TIFF tags. */ -class KnownTags +struct CODA_OSS_API KnownTags final { -public: - KnownTags(); //! Destructor @@ -71,14 +70,13 @@ class KnownTags tiff::IFDEntry *operator[](const unsigned short tagKey); //! Some common tags - static const char IMAGE_WIDTH[]; - static const char IMAGE_LENGTH[]; - static const char BITS_PER_SAMPLE[]; - static const char COMPRESSION[]; - static const char SAMPLES_PER_PIXEL[]; - static const char PHOTOMETRIC_INTERPRETATION[]; - static const char SAMPLE_FORMAT[]; - + static constexpr auto IMAGE_WIDTH = "ImageWidth"; + static constexpr auto IMAGE_LENGTH = "ImageLength"; + static constexpr auto BITS_PER_SAMPLE = "BitsPerSample"; + static constexpr auto COMPRESSION = "Compression"; + static constexpr auto SAMPLES_PER_PIXEL = "SamplesPerPixel"; + static constexpr auto PHOTOMETRIC_INTERPRETATION = "PhotometricInterpretation"; + static constexpr auto SAMPLE_FORMAT = "SampleFormat"; /** ***************************************************************** diff --git a/modules/c++/tiff/include/tiff/TiffFileReader.h b/modules/c++/tiff/include/tiff/TiffFileReader.h index 47417b0db0..9d02446e9c 100644 --- a/modules/c++/tiff/include/tiff/TiffFileReader.h +++ b/modules/c++/tiff/include/tiff/TiffFileReader.h @@ -19,13 +19,15 @@ * see . * */ - +#pragma once #ifndef __TIFF_FILE_READER_H__ #define __TIFF_FILE_READER_H__ #include #include + #include +#include #include "tiff/Header.h" #include "tiff/ImageReader.h" @@ -42,7 +44,7 @@ namespace tiff * to access a specific image within the file, and to read data from * a specific image in the file. *********************************************************************/ -struct FileReader +struct CODA_OSS_API FileReader { FileReader() = default; diff --git a/modules/c++/tiff/include/tiff/TiffFileWriter.h b/modules/c++/tiff/include/tiff/TiffFileWriter.h index f6474c6e2e..bf994ba869 100644 --- a/modules/c++/tiff/include/tiff/TiffFileWriter.h +++ b/modules/c++/tiff/include/tiff/TiffFileWriter.h @@ -19,13 +19,16 @@ * see . * */ - +#pragma once #ifndef __TIFF_FILE_WRITER_H__ #define __TIFF_FILE_WRITER_H__ #include #include + #include +#include + #include "tiff/Header.h" #include "tiff/ImageWriter.h" @@ -41,7 +44,7 @@ namespace tiff * to the same file. Contains function for manipulating each * sub-image and for writing data. *********************************************************************/ -struct FileWriter +struct CODA_OSS_API FileWriter { //! Constructor FileWriter() : diff --git a/modules/c++/tiff/include/tiff/TypeFactory.h b/modules/c++/tiff/include/tiff/TypeFactory.h index 5c4f21f025..5fe9c4730f 100644 --- a/modules/c++/tiff/include/tiff/TypeFactory.h +++ b/modules/c++/tiff/include/tiff/TypeFactory.h @@ -19,10 +19,12 @@ * see . * */ - +#pragma once #ifndef __TIFF_TYPE_FACTORY_H__ #define __TIFF_TYPE_FACTORY_H__ +#include "config/Exports.h" + #include "tiff/GenericType.h" namespace tiff @@ -38,7 +40,7 @@ namespace tiff * assume a specific size for the data, see tiff::Const for the size * of each TIFF type. *********************************************************************/ -class TypeFactory +class CODA_OSS_API TypeFactory final { public: //! Default constructor diff --git a/modules/c++/tiff/source/KnownTags.cpp b/modules/c++/tiff/source/KnownTags.cpp index 60b3290794..ad7fa89827 100644 --- a/modules/c++/tiff/source/KnownTags.cpp +++ b/modules/c++/tiff/source/KnownTags.cpp @@ -28,14 +28,6 @@ #include "tiff/IFDEntry.h" #include -const char tiff::KnownTags::IMAGE_WIDTH[] = "ImageWidth"; -const char tiff::KnownTags::IMAGE_LENGTH[] = "ImageLength"; -const char tiff::KnownTags::BITS_PER_SAMPLE[] = "BitsPerSample"; -const char tiff::KnownTags::COMPRESSION[] = "Compression"; -const char tiff::KnownTags::SAMPLES_PER_PIXEL[] = "SamplesPerPixel"; -const char tiff::KnownTags::PHOTOMETRIC_INTERPRETATION[] = "PhotometricInterpretation"; -const char tiff::KnownTags::SAMPLE_FORMAT[] = "SampleFormat"; - tiff::KnownTags::KnownTags() { addEntry(254, tiff::Const::Type::LONG, "NewSubfileType"); diff --git a/modules/c++/xml.lite/include/xml/lite/Element.h b/modules/c++/xml.lite/include/xml/lite/Element.h index 323b77aba3..ee4e05346e 100644 --- a/modules/c++/xml.lite/include/xml/lite/Element.h +++ b/modules/c++/xml.lite/include/xml/lite/Element.h @@ -499,7 +499,7 @@ struct CODA_OSS_API Element // SOAPElement derives :-( coda_oss::u8string mCharacterData; }; -Element& add(const xml::lite::QName&, const std::string& value, Element& parent); +CODA_OSS_API Element& add(const xml::lite::QName&, const std::string& value, Element& parent); #ifndef SWIG // The (old) version of SWIG we're using doesn't like certain C++11 features.