diff --git a/CMakeLists.txt b/CMakeLists.txt index 791cde368a..12ae5b37e5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,7 +2,7 @@ # Copyright Contributors to the OpenEXR Project. # We require this to get object library link library support -if(OPENEXR_BUILD_BOTH_STATIC_SHARED OR ILMBASE_BUILD_BOTH_STATIC_SHARED) +if(OPENEXR_BUILD_BOTH_STATIC_SHARED) if (${CMAKE_VERSION} VERSION_LESS "3.12.0") message(FATAL_ERROR "CMake 3.12 or newer is required for object library support when building both static and shared libraries") endif() diff --git a/INSTALL.md b/INSTALL.md index fc9f55ca75..4599cbd955 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -129,10 +129,7 @@ these options. If you are interested in controlling custom namespace declarations or similar options, you are encouraged to look at the ``CMakeLists.txt`` -infrastructure. In particular, there has been an attempt to centralize -the settings into a common place to more easily see all of them in a -text editor. For IlmBase, this is config/IlmBaseSetup.cmake inside the -IlmBase tree. For OpenEXR, the settings will similarly be found in +infrastructure. The settings can be found in ``cmake/OpenEXRSetup.cmake``. As per usual, these settings can also be seen and/or edited using any of the various gui editors for working with cmake such as ``ccmake``, ``cmake-gui``, as well as some of the @@ -199,70 +196,49 @@ You can customize these options three ways: ### Library Naming Options: -* **ILMBASE\_LIB\_SUFFIX** - - Append the given string to the end of all the IlmBase libraries. Default is ``-_`` version string. Please see the section on library names - * **OPENEXR\_LIB\_SUFFIX** Append the given string to the end of all the OpenEXR libraries. Default is ``-_`` version string. Please see the section on library names ### Namespace Options: -* **ILMBASE\_IEX\_NAMESPACE** - - Public namespace alias for Iex. Default is ``Iex``. - -* **ILMBASE\_ILMTHREAD\_NAMESPACE** - - Public namespace alias for IlmThread. Default is ``IlmThread``. - -* **ILMBASE\_IMATH\_NAMESPACE** +* **OPENEXR\_IMF\_NAMESPACE** - Public namespace alias for Imath. Default is ``Imath``. + Public namespace alias for OpenEXR. Default is ``Imf``. -* **ILMBASE\_INTERNAL\_IEX\_NAMESPACE** +* **OPENEXR\_INTERNAL\_IMF\_NAMESPACE** - Real namespace for Iex that will end up in compiled symbols. Default is ``Iex\_\_``. + Real namespace for OpenEXR that will end up in compiled symbols. Default is ``Imf\_\_``. -* **ILMBASE\_INTERNAL\_ILMTHREAD\_NAMESPACE** +* **OPENEXR\_NAMESPACE\_CUSTOM** - Real namespace for IlmThread that will end up in compiled symbols. Default is ``IlmThread\_\_``. + Whether the namespace has been customized (so external users know) -* **ILMBASE\_INTERNAL\_IMATH\_NAMESPACE** - - Real namespace for Imath that will end up in compiled symbols. Default is ``Imath\_\_``. -* **ILMBASE\_NAMESPACE\_CUSTOM** - - Whether the namespace has been customized (so external users know) +* **IEX\_NAMESPACE** -* **OPENEXR\_IMF\_NAMESPACE** - - Public namespace alias for Imath. Default is ``Imf``. + Public namespace alias for Iex. Default is ``Iex``. -* **OPENEXR\_INTERNAL\_IMF\_NAMESPACE** +* **IEX\_INTERNAL\_NAMESPACE** - Real namespace for Imath that will end up in compiled symbols. Default is ``Imf\_\_``. + Real namespace for Iex that will end up in compiled symbols. Default is ``Iex\_\_``. -* **OPENEXR\_NAMESPACE\_CUSTOM** +* **IEX\_NAMESPACE\_CUSTOM** Whether the namespace has been customized (so external users know) -### Linting Options: -These linting options are experimental, and primarily for developer-only use at this time. +* **ILMTHREAD\_NAMESPACE** -* **ILMBASE\_USE\_CLANG\_TIDY** - - Enable clang-tidy for IlmBase libraries, if it is available. Default is OFF. + Public namespace alias for IlmThread. Default is ``IlmThread``. -* **OPENEXR\_USE\_CLANG\_TIDY** +* **ILMTHREAD\_INTERNAL\_NAMESPACE** - Enable clang-tidy for OpenEXR libraries, if it is available. Default is OFF. - -### Testing Options: + Real namespace for IlmThread that will end up in compiled symbols. Default is ``IlmThread\_\_``. +* **ILMTHREAD\_NAMESPACE\_CUSTOM** + + Whether the namespace has been customized (so external users know) * **BUILD\_TESTING** diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index be49eb1915..ce09499a57 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -69,40 +69,40 @@ install( ) ################################################### -####### IlmBaseConfig.h and IlmBaseConfigInternal.h +####### IexConfig.h and IexConfigInternal.h -check_include_files(ucontext.h ILMBASE_HAVE_UCONTEXT_H) -if(ILMBASE_HAVE_UCONTEXT_H) - # TODO: remove this once we cleanly have ILMBASE_ prefix on all #defines +check_include_files(ucontext.h IEX_HAVE_UCONTEXT_H) +if(IEX_HAVE_UCONTEXT_H) + # TODO: remove this once we cleanly have IEX_ prefix on all #defines set(HAVE_UCONTEXT_H ON) - check_struct_has_member("struct _libc_fpstate" mxcsr ucontext.h ILMBASE_HAVE_CONTROL_REGISTER_SUPPORT) - if(NOT ILMBASE_HAVE_CONTROL_REGISTER_SUPPORT) - check_include_files(asm/sigcontext.h ILMBASE_HAVE_SIGCONTEXT_H) - if(ILMBASE_HAVE_SIGCONTEXT_H) - check_struct_has_member("struct _fpstate" mxcsr asm/sigcontext.h ILMBASE_HAVE_SIGCONTEXT_CONTROL_REGISTER_SUPPORT) + check_struct_has_member("struct _libc_fpstate" mxcsr ucontext.h IEX_HAVE_CONTROL_REGISTER_SUPPORT) + if(NOT IEX_HAVE_CONTROL_REGISTER_SUPPORT) + check_include_files(asm/sigcontext.h IEX_HAVE_SIGCONTEXT_H) + if(IEX_HAVE_SIGCONTEXT_H) + check_struct_has_member("struct _fpstate" mxcsr asm/sigcontext.h IEX_HAVE_SIGCONTEXT_CONTROL_REGISTER_SUPPORT) endif() endif() endif() -###check_include_files(pthread.h ILMBASE_HAVE_PTHREAD) +###check_include_files(pthread.h ILMTHREAD_HAVE_PTHREAD) if(OPENEXR_ENABLE_THREADING AND Threads_FOUND) - set(ILMBASE_THREADING_ENABLED ON) + set(ILMTHREAD_THREADING_ENABLED ON) if(CMAKE_HAVE_PTHREAD_H OR CMAKE_USE_PTHREADS_INIT OR CMAKE_HP_PTHREAD_INIT) - set(ILMBASE_HAVE_PTHREAD ON) + set(ILMTHREAD_HAVE_PTHREAD ON) endif() # we have threads, but do we have posix semaphores for sem_init? # should be in pthreads if(NOT (APPLE OR (WIN32 AND (NOT MINGW)))) if(MINGW) - check_include_files("pthread_unistd.h;semaphore.h" ILMBASE_HAVE_SEMAPHORE_H) + check_include_files("pthread_unistd.h;semaphore.h" ILMTHREAD_HAVE_SEMAPHORE_H) else() - check_include_files(semaphore.h ILMBASE_HAVE_SEMAPHORE_H) + check_include_files(semaphore.h ILMTHREAD_HAVE_SEMAPHORE_H) endif() - if(ILMBASE_HAVE_SEMAPHORE_H AND ILMBASE_HAVE_PTHREAD) + if(ILMTHREAD_HAVE_SEMAPHORE_H AND ILMTHREAD_HAVE_PTHREAD) # should just be in libc, so no need for check_library_exists set(CMAKE_REQUIRED_FLAGS ${CMAKE_THREAD_LIBS_INIT}) - check_library_exists(pthread sem_init "" ILMBASE_HAVE_POSIX_SEMAPHORES) + check_library_exists(pthread sem_init "" ILMTHREAD_HAVE_POSIX_SEMAPHORES) set(CMAKE_REQUIRED_FLAGS) endif() endif() @@ -112,8 +112,9 @@ if (OPENEXR_ENABLE_LARGE_STACK) set(OPENEXR_HAVE_LARGE_STACK ON) endif() -configure_file(IlmBaseConfig.h.in ${CMAKE_CURRENT_BINARY_DIR}/IlmBaseConfig.h) -configure_file(IlmBaseConfigInternal.h.in ${CMAKE_CURRENT_BINARY_DIR}/IlmBaseConfigInternal.h) +configure_file(IexConfig.h.in ${CMAKE_CURRENT_BINARY_DIR}/IexConfig.h) +configure_file(IexConfigInternal.h.in ${CMAKE_CURRENT_BINARY_DIR}/IexConfigInternal.h) +configure_file(IlmThreadConfig.h.in ${CMAKE_CURRENT_BINARY_DIR}/IlmThreadConfig.h) ################################################### ####### Install public config headers @@ -121,7 +122,8 @@ configure_file(IlmBaseConfigInternal.h.in ${CMAKE_CURRENT_BINARY_DIR}/IlmBaseCon install( FILES ${CMAKE_CURRENT_BINARY_DIR}/OpenEXRConfig.h - ${CMAKE_CURRENT_BINARY_DIR}/IlmBaseConfig.h + ${CMAKE_CURRENT_BINARY_DIR}/IexConfig.h + ${CMAKE_CURRENT_BINARY_DIR}/IlmThreadConfig.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${OPENEXR_OUTPUT_SUBDIR} ) @@ -138,14 +140,23 @@ target_include_directories(OpenEXRConfig INTERFACE install(TARGETS OpenEXRConfig EXPORT ${PROJECT_NAME}) add_library(${PROJECT_NAME}::Config ALIAS OpenEXRConfig) -add_library(IlmBaseConfig INTERFACE) -target_include_directories(IlmBaseConfig INTERFACE +add_library(IexConfig INTERFACE) +target_include_directories(IexConfig INTERFACE $ $ - $) + $) + +install(TARGETS IexConfig EXPORT ${PROJECT_NAME}) +add_library(${PROJECT_NAME}::Config ALIAS IexConfig) + +add_library(IlmThreadConfig INTERFACE) +target_include_directories(IlmThreadConfig INTERFACE + $ + $ + $) -install(TARGETS IlmBaseConfig EXPORT ${PROJECT_NAME}) -add_library(${PROJECT_NAME}::Config ALIAS IlmBaseConfig) +install(TARGETS IlmThreadConfig EXPORT ${PROJECT_NAME}) +add_library(${PROJECT_NAME}::Config ALIAS IlmThreadConfig) ################################################### ####### Install pkg-config files if requested @@ -177,7 +188,6 @@ if(OPENEXR_INSTALL_PKG_CONFIG) ) endfunction() openexr_pkg_config_help(OpenEXR.pc.in) - openexr_pkg_config_help(IlmBase.pc.in) else() message(STATUS "-- pkg-config generation disabled") endif() diff --git a/cmake/IexConfig.h.in b/cmake/IexConfig.h.in new file mode 100644 index 0000000000..584b6c90a9 --- /dev/null +++ b/cmake/IexConfig.h.in @@ -0,0 +1,28 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright Contributors to the OpenEXR Project. + +// This file is auto-generated by the cmake configure step + +#ifndef INCLUDED_IEX_CONFIG_H +#define INCLUDED_IEX_CONFIG_H 1 + +#pragma once + +// +// +// C++ namespace configuration / options + +// +// Current internal library namepace name +// +#define IEX_INTERNAL_NAMESPACE_CUSTOM @IEX_NAMESPACE_CUSTOM@ +#define IEX_INTERNAL_NAMESPACE @IEX_INTERNAL_NAMESPACE@ + +// +// Current public user namepace name +// + +#define IEX_NAMESPACE_CUSTOM @IEX_NAMESPACE_CUSTOM@ +#define IEX_NAMESPACE @IEX_NAMESPACE@ + +#endif // INCLUDED_IEX_CONFIG_H diff --git a/cmake/IlmBaseConfigInternal.h.in b/cmake/IexConfigInternal.h.in similarity index 58% rename from cmake/IlmBaseConfigInternal.h.in rename to cmake/IexConfigInternal.h.in index 49b889166c..b82584a7f3 100644 --- a/cmake/IlmBaseConfigInternal.h.in +++ b/cmake/IexConfigInternal.h.in @@ -7,5 +7,5 @@ // Dealing with FPEs // #cmakedefine HAVE_UCONTEXT_H 1 -#cmakedefine ILMBASE_HAVE_CONTROL_REGISTER_SUPPORT 1 -#cmakedefine ILMBASE_HAVE_SIGCONTEXT_CONTROL_REGISTER_SUPPORT 1 +#cmakedefine IEX_HAVE_CONTROL_REGISTER_SUPPORT 1 +#cmakedefine IEX_HAVE_SIGCONTEXT_CONTROL_REGISTER_SUPPORT 1 diff --git a/cmake/IlmBase.pc.in b/cmake/IlmBase.pc.in deleted file mode 100644 index 4560b67dc8..0000000000 --- a/cmake/IlmBase.pc.in +++ /dev/null @@ -1,17 +0,0 @@ -## -## SPDX-License-Identifier: BSD-3-Clause -## Copyright Contributors to the OpenEXR Project. -## - -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -includedir=@includedir@ -libsuffix=@LIB_SUFFIX_DASH@ -Name: IlmBase -Description: Base math and exception libraries -Version: @ILMBASE_VERSION@ -Requires: -Conflicts: -Libs: -L${libdir} -lIex${libsuffix} -lIexMath${libsuffix} -lIlmThread${libsuffix} @PTHREAD_LIBS@ -Cflags: @PTHREAD_CFLAGS@ -I${includedir} -I${includedir}/OpenEXR diff --git a/cmake/IlmBaseConfig.h.in b/cmake/IlmBaseConfig.h.in deleted file mode 100644 index e4d893e07a..0000000000 --- a/cmake/IlmBaseConfig.h.in +++ /dev/null @@ -1,58 +0,0 @@ -// SPDX-License-Identifier: BSD-3-Clause -// Copyright Contributors to the OpenEXR Project. - -// This file is auto-generated by the cmake configure step - -#ifndef INCLUDED_ILMBASE_CONFIG_H -#define INCLUDED_ILMBASE_CONFIG_H 1 - -#pragma once - -// -// Options / configuration based on O.S. / compiler -///////////////////// - -#cmakedefine01 ILMBASE_THREADING_ENABLED -#cmakedefine01 ILMBASE_HAVE_POSIX_SEMAPHORES - -////////////////////// -// -// C++ namespace configuration / options - -// Current (internal) library namepace name and corresponding public -// client namespaces. -#define ILMBASE_INTERNAL_NAMESPACE_CUSTOM @ILMBASE_NAMESPACE_CUSTOM@ -#define IEX_INTERNAL_NAMESPACE @ILMBASE_INTERNAL_IEX_NAMESPACE@ -#define ILMTHREAD_INTERNAL_NAMESPACE @ILMBASE_INTERNAL_ILMTHREAD_NAMESPACE@ - -#define ILMBASE_NAMESPACE_CUSTOM @ILMBASE_NAMESPACE_CUSTOM@ -#define IEX_NAMESPACE @ILMBASE_IEX_NAMESPACE@ -#define ILMTHREAD_NAMESPACE @ILMBASE_ILMTHREAD_NAMESPACE@ - -// -// Version information -// -#define ILMBASE_VERSION_STRING "@OPENEXR_VERSION@" -#define ILMBASE_PACKAGE_STRING "@ILMBASE_PACKAGE_NAME@" - -#define ILMBASE_VERSION_MAJOR @OPENEXR_VERSION_MAJOR@ -#define ILMBASE_VERSION_MINOR @OPENEXR_VERSION_MINOR@ -#define ILMBASE_VERSION_PATCH @OPENEXR_VERSION_PATCH@ - -#define ILMBASE_VERSION_HEX ((uint32_t(ILMBASE_VERSION_MAJOR) << 24) | \ - (uint32_t(ILMBASE_VERSION_MINOR) << 16) | \ - (uint32_t(ILMBASE_VERSION_PATCH) << 8)) - -#if defined(__cplusplus) && (__cplusplus >= 201402L) -# define ILMBASE_DEPRECATED(msg) [[deprecated(msg)]] -#endif - -#ifndef ILMBASE_DEPRECATED -# ifdef _MSC_VER -# define ILMBASE_DEPRECATED(msg) __declspec(deprecated(msg)) -# else -# define ILMBASE_DEPRECATED(msg) __attribute__((deprecated(msg))) -# endif -#endif - -#endif // INCLUDED_ILMBASE_CONFIG_H diff --git a/cmake/IlmThreadConfig.h.in b/cmake/IlmThreadConfig.h.in new file mode 100644 index 0000000000..f34acccb58 --- /dev/null +++ b/cmake/IlmThreadConfig.h.in @@ -0,0 +1,43 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright Contributors to the OpenEXR Project. + +// This file is auto-generated by the cmake configure step + +#ifndef INCLUDED_ILMTHREAD_CONFIG_H +#define INCLUDED_ILMTHREAD_CONFIG_H 1 + +#pragma once + +// +// +// C++ namespace configuration / options + +#cmakedefine01 ILMTHREAD_THREADING_ENABLED +#cmakedefine01 ILMTHREAD_HAVE_POSIX_SEMAPHORES + +// +// Current internal library namepace name +// +#define ILMTHREAD_INTERNAL_NAMESPACE_CUSTOM @ILMTHREAD_NAMESPACE_CUSTOM@ +#define ILMTHREAD_INTERNAL_NAMESPACE @ILMTHREAD_INTERNAL_NAMESPACE@ + +// +// Current public user namepace name +// + +#define ILMTHREAD_NAMESPACE_CUSTOM @ILMTHREAD_NAMESPACE_CUSTOM@ +#define ILMTHREAD_NAMESPACE @ILMTHREAD_NAMESPACE@ + +#if defined(__cplusplus) && (__cplusplus >= 201402L) +# define ILMTHREAD_DEPRECATED(msg) [[deprecated(msg)]] +#endif + +#ifndef ILMTHREAD_DEPRECATED +# ifdef _MSC_VER +# define ILMTHREAD_DEPRECATED(msg) __declspec(deprecated(msg)) +# else +# define ILMTHREAD_DEPRECATED(msg) __attribute__((deprecated(msg))) +# endif +#endif + +#endif // INCLUDED_ILMTHREAD_CONFIG_H diff --git a/cmake/LibraryDefine.cmake b/cmake/LibraryDefine.cmake index d2b178f2fc..8066d45a6d 100644 --- a/cmake/LibraryDefine.cmake +++ b/cmake/LibraryDefine.cmake @@ -1,7 +1,7 @@ # SPDX-License-Identifier: BSD-3-Clause # Copyright Contributors to the OpenEXR Project. -# NB: This function has a number if IlmBase specific names / variables +# NB: This function has a number of Imath-specific names/variables # in it, so be careful copying... function(OPENEXR_DEFINE_LIBRARY libname) set(options) @@ -20,7 +20,7 @@ function(OPENEXR_DEFINE_LIBRARY libname) set(use_objlib) endif() if (MSVC) - set(_ilmbase_extra_flags "/EHsc") + set(_imath_extra_flags "/EHsc") endif() if(use_objlib) set(objlib ${libname}_Object) @@ -56,8 +56,8 @@ function(OPENEXR_DEFINE_LIBRARY libname) CXX_EXTENSIONS OFF POSITION_INDEPENDENT_CODE ON ) - if (_ilmbase_extra_flags) - target_compile_options(${objlib} PUBLIC ${_ilmbase_extra_flags}) + if (_imath_extra_flags) + target_compile_options(${objlib} PUBLIC ${_imath_extra_flags}) endif() set_property(TARGET ${objlib} PROPERTY PUBLIC_HEADER ${OPENEXR_CURLIB_HEADERS}) diff --git a/cmake/OpenEXR.pc.in b/cmake/OpenEXR.pc.in index 2ffc3960a0..b7881c4466 100644 --- a/cmake/OpenEXR.pc.in +++ b/cmake/OpenEXR.pc.in @@ -15,6 +15,6 @@ Description: OpenEXR image library Version: @OPENEXR_VERSION@ Libs: -L${libdir} -lOpenEXR${libsuffix} -Cflags: -I${OpenEXR_includedir} -Requires: IlmBase +Cflags: -I${includedir} +Requires: Imath Libs.private: @zlib_link@ diff --git a/cmake/OpenEXRSetup.cmake b/cmake/OpenEXRSetup.cmake index b4d9e043ae..9bbdc1dd18 100644 --- a/cmake/OpenEXRSetup.cmake +++ b/cmake/OpenEXRSetup.cmake @@ -27,14 +27,15 @@ set(OPENEXR_PACKAGE_NAME "OpenEXR ${OPENEXR_VERSION}" CACHE STRING "Public strin # Namespace-related settings, allows one to customize the # namespace generated, and to version the namespaces -set(ILMBASE_NAMESPACE_CUSTOM "0" CACHE STRING "Whether the namespace has been customized (so external users know)") -set(ILMBASE_INTERNAL_IEX_NAMESPACE "Iex_${ILMBASE_VERSION_API}" CACHE STRING "Real namespace for Iex that will end up in compiled symbols") -set(ILMBASE_INTERNAL_ILMTHREAD_NAMESPACE "IlmThread_${ILMBASE_VERSION_API}" CACHE STRING "Real namespace for IlmThread that will end up in compiled symbols") -set(ILMBASE_IEX_NAMESPACE "Iex" CACHE STRING "Public namespace alias for Iex") -set(ILMBASE_ILMTHREAD_NAMESPACE "IlmThread" CACHE STRING "Public namespace alias for IlmThread") -set(ILMBASE_PACKAGE_NAME "IlmBase ${ILMBASE_VERSION}" CACHE STRING "Public string / label for displaying package") - -# Whether to generate and install a pkg-config file OpenEXR.pc and IlmBase.pc +set(ILMTHREAD_NAMESPACE_CUSTOM "0" CACHE STRING "Whether the namespace has been customized (so external users know)") +set(ILMTHREAD_INTERNAL_NAMESPACE "IlmThread_${OPENEXR_VERSION_API}" CACHE STRING "Real namespace for IlmThread that will end up in compiled symbols") +set(ILMTHREAD_NAMESPACE "IlmThread" CACHE STRING "Public namespace alias for IlmThread") + +set(IEX_NAMESPACE_CUSTOM "0" CACHE STRING "Whether the namespace has been customized (so external users know)") +set(IEX_INTERNAL_NAMESPACE "Iex_${OPENEXR_VERSION_API}" CACHE STRING "Real namespace for Iex that will end up in compiled symbols") +set(IEX_NAMESPACE "Iex" CACHE STRING "Public namespace alias for Iex") + +# Whether to generate and install a pkg-config file OpenEXR.pc if (WIN32) option(OPENEXR_INSTALL_PKG_CONFIG "Install OpenEXR.pc file" OFF) else() diff --git a/src/lib/Iex/CMakeLists.txt b/src/lib/Iex/CMakeLists.txt index c1272f38e7..504119597b 100644 --- a/src/lib/Iex/CMakeLists.txt +++ b/src/lib/Iex/CMakeLists.txt @@ -17,4 +17,6 @@ openexr_define_library(Iex IexNamespace.h IexExport.h IexForward.h + DEPENDENCIES + OpenEXR::Config ) diff --git a/src/lib/Iex/IexNamespace.h b/src/lib/Iex/IexNamespace.h index bef1572283..78707e2b17 100644 --- a/src/lib/Iex/IexNamespace.h +++ b/src/lib/Iex/IexNamespace.h @@ -72,10 +72,10 @@ // // -// Open Source version of this file pulls in the IlmBaseConfig.h file +// Open Source version of this file pulls in the IexConfig.h file // for the configure time options. // -#include "IlmBaseConfig.h" +#include "IexConfig.h" #ifndef IEX_NAMESPACE #define IEX_NAMESPACE Iex diff --git a/src/lib/IexMath/CMakeLists.txt b/src/lib/IexMath/CMakeLists.txt index 8aadce39d4..d519884805 100644 --- a/src/lib/IexMath/CMakeLists.txt +++ b/src/lib/IexMath/CMakeLists.txt @@ -12,5 +12,6 @@ openexr_define_library(IexMath IexMathFpu.h IexMathIeeeExc.h DEPENDENCIES + OpenEXR::Config OpenEXR::Iex ) diff --git a/src/lib/IexMath/IexMathFpu.cpp b/src/lib/IexMath/IexMathFpu.cpp index 439329e503..d4a44b3d71 100644 --- a/src/lib/IexMath/IexMathFpu.cpp +++ b/src/lib/IexMath/IexMathFpu.cpp @@ -42,7 +42,7 @@ #include "IexMathFpu.h" #include -#include +#include #include #if 0 @@ -52,10 +52,10 @@ #define debug(x) #endif -#include +#include #if defined(HAVE_UCONTEXT_H) && \ - (defined(ILMBASE_HAVE_SIGCONTEXT_CONTROL_REGISTER_SUPPORT) || \ - defined(ILMBASE_HAVE_CONTROL_REGISTER_SUPPORT)) + (defined(IEX_HAVE_SIGCONTEXT_CONTROL_REGISTER_SUPPORT) || \ + defined(IEX_HAVE_CONTROL_REGISTER_SUPPORT)) # include # include @@ -258,7 +258,7 @@ const uint16_t cwRestoreMask = ~((3 << 10) | (3 << 8)); const uint16_t cwRestoreVal = (0 << 10) | (3 << 8); -#ifdef ILMBASE_HAVE_CONTROL_REGISTER_SUPPORT +#ifdef IEX_HAVE_CONTROL_REGISTER_SUPPORT inline void restoreControlRegs (const ucontext_t & ucon, bool clearExceptions) diff --git a/src/lib/IlmThread/CMakeLists.txt b/src/lib/IlmThread/CMakeLists.txt index f724b0ff15..7a750e1773 100644 --- a/src/lib/IlmThread/CMakeLists.txt +++ b/src/lib/IlmThread/CMakeLists.txt @@ -21,6 +21,7 @@ openexr_define_library(IlmThread IlmThreadExport.h IlmThreadForward.h DEPENDENCIES + OpenEXR::Config OpenEXR::Iex ) diff --git a/src/lib/IlmThread/IlmThread.cpp b/src/lib/IlmThread/IlmThread.cpp index 4fc42d9861..6328ba9d2f 100644 --- a/src/lib/IlmThread/IlmThread.cpp +++ b/src/lib/IlmThread/IlmThread.cpp @@ -40,13 +40,13 @@ // //----------------------------------------------------------------------------- -#include "IlmBaseConfig.h" +#include "IlmThreadConfig.h" #include "IlmThread.h" #include "Iex.h" ILMTHREAD_INTERNAL_NAMESPACE_SOURCE_ENTER -#if ILMBASE_THREADING_ENABLED +#if ILMTHREAD_THREADING_ENABLED bool supportsThreads () diff --git a/src/lib/IlmThread/IlmThread.h b/src/lib/IlmThread/IlmThread.h index 593782cb33..35adc091e1 100644 --- a/src/lib/IlmThread/IlmThread.h +++ b/src/lib/IlmThread/IlmThread.h @@ -90,11 +90,11 @@ // //----------------------------------------------------------------------------- -#include "IlmBaseConfig.h" +#include "IlmThreadConfig.h" #include "IlmThreadExport.h" #include "IlmThreadNamespace.h" -#if ILMBASE_THREADING_ENABLED +#if ILMTHREAD_THREADING_ENABLED #include #endif @@ -126,7 +126,7 @@ class Thread private: -#if ILMBASE_THREADING_ENABLED +#if ILMTHREAD_THREADING_ENABLED std::thread _thread; #endif diff --git a/src/lib/IlmThread/IlmThreadForward.h b/src/lib/IlmThread/IlmThreadForward.h index 599072facb..89fc12812a 100644 --- a/src/lib/IlmThread/IlmThreadForward.h +++ b/src/lib/IlmThread/IlmThreadForward.h @@ -35,17 +35,17 @@ #ifndef INCLUDED_ILMTHREADFORWARD_H #define INCLUDED_ILMTHREADFORWARD_H -#include "IlmBaseConfig.h" +#include "IlmThreadConfig.h" #include "IlmThreadNamespace.h" -#if ILMBASE_THREADING_ENABLED +#if ILMTHREAD_THREADING_ENABLED namespace std { class mutex; } #endif ILMTHREAD_INTERNAL_NAMESPACE_HEADER_ENTER class Thread; -#if ILMBASE_THREADING_ENABLED +#if ILMTHREAD_THREADING_ENABLED using Mutex = std::mutex; #else class Mutex; diff --git a/src/lib/IlmThread/IlmThreadMutex.h b/src/lib/IlmThread/IlmThreadMutex.h index 59e4433615..6e381f3c08 100644 --- a/src/lib/IlmThread/IlmThreadMutex.h +++ b/src/lib/IlmThread/IlmThreadMutex.h @@ -43,17 +43,17 @@ //----------------------------------------------------------------------------- #include "IlmThreadExport.h" -#include "IlmBaseConfig.h" +#include "IlmThreadConfig.h" #include "IlmThreadNamespace.h" -#if ILMBASE_THREADING_ENABLED +#if ILMTHREAD_THREADING_ENABLED #include #endif ILMTHREAD_INTERNAL_NAMESPACE_HEADER_ENTER -#if ILMBASE_THREADING_ENABLED -using Mutex ILMBASE_DEPRECATED ("replace with std::mutex") = std::mutex; +#if ILMTHREAD_THREADING_ENABLED +using Mutex ILMTHREAD_DEPRECATED ("replace with std::mutex") = std::mutex; // unfortunately we can't use std::unique_lock as a replacement for Lock since // they have different API. Let us deprecate for now and give people a chance @@ -62,7 +62,7 @@ class ILMTHREAD_EXPORT Lock { public: - ILMBASE_DEPRECATED ("replace with std::lock_guard or std::unique_lock") + ILMTHREAD_DEPRECATED ("replace with std::lock_guard or std::unique_lock") Lock (const Mutex& m, bool autoLock = true): _mutex (const_cast(m)), _locked (false) { diff --git a/src/lib/IlmThread/IlmThreadNamespace.h b/src/lib/IlmThread/IlmThreadNamespace.h index a4129971a7..179676e366 100644 --- a/src/lib/IlmThread/IlmThreadNamespace.h +++ b/src/lib/IlmThread/IlmThreadNamespace.h @@ -73,10 +73,10 @@ // // -// Open Source version of this file pulls in the IlmBaseConfig.h file +// Open Source version of this file pulls in the IlmThreadConfig.h file // for the configure time options. // -#include "IlmBaseConfig.h" +#include "IlmThreadConfig.h" #ifndef ILMTHREAD_NAMESPACE #define ILMTHREAD_NAMESPACE IlmThread diff --git a/src/lib/IlmThread/IlmThreadPool.cpp b/src/lib/IlmThread/IlmThreadPool.cpp index 13247f676a..b10e5ec7fd 100644 --- a/src/lib/IlmThread/IlmThreadPool.cpp +++ b/src/lib/IlmThread/IlmThreadPool.cpp @@ -53,7 +53,7 @@ using namespace std; ILMTHREAD_INTERNAL_NAMESPACE_SOURCE_ENTER -#if ILMBASE_THREADING_ENABLED +#if ILMTHREAD_THREADING_ENABLED # define ENABLE_THREADING #endif diff --git a/src/lib/IlmThread/IlmThreadPool.h b/src/lib/IlmThread/IlmThreadPool.h index f7a93fec7a..ed81b427c4 100644 --- a/src/lib/IlmThread/IlmThreadPool.h +++ b/src/lib/IlmThread/IlmThreadPool.h @@ -63,7 +63,7 @@ #include "IlmThreadNamespace.h" #include "IlmThreadExport.h" -#include "IlmBaseConfig.h" +#include "IlmThreadConfig.h" ILMTHREAD_INTERNAL_NAMESPACE_HEADER_ENTER diff --git a/src/lib/IlmThread/IlmThreadSemaphore.cpp b/src/lib/IlmThread/IlmThreadSemaphore.cpp index 335e7bb278..1da1c36125 100644 --- a/src/lib/IlmThread/IlmThreadSemaphore.cpp +++ b/src/lib/IlmThread/IlmThreadSemaphore.cpp @@ -39,9 +39,9 @@ // //----------------------------------------------------------------------------- -#include "IlmBaseConfig.h" +#include "IlmThreadConfig.h" -#if !(ILMBASE_THREADING_ENABLED) +#if !(ILMTHREAD_THREADING_ENABLED) #include "IlmThreadSemaphore.h" diff --git a/src/lib/IlmThread/IlmThreadSemaphore.h b/src/lib/IlmThread/IlmThreadSemaphore.h index 71995c51a5..02c8b8d79a 100644 --- a/src/lib/IlmThread/IlmThreadSemaphore.h +++ b/src/lib/IlmThread/IlmThreadSemaphore.h @@ -44,11 +44,11 @@ #include "IlmThreadExport.h" -#include "IlmBaseConfig.h" +#include "IlmThreadConfig.h" #include "IlmThreadNamespace.h" -#if ILMBASE_THREADING_ENABLED -# if ILMBASE_HAVE_POSIX_SEMAPHORES +#if ILMTHREAD_THREADING_ENABLED +# if ILMTHREAD_HAVE_POSIX_SEMAPHORES # include # elif defined(__APPLE__) # include @@ -81,7 +81,7 @@ class ILMTHREAD_EXPORT Semaphore private: -#if ILMBASE_HAVE_POSIX_SEMAPHORES +#if ILMTHREAD_HAVE_POSIX_SEMAPHORES mutable sem_t _semaphore; @@ -92,7 +92,7 @@ class ILMTHREAD_EXPORT Semaphore mutable HANDLE _semaphore; -#elif ILMBASE_THREADING_ENABLED +#elif ILMTHREAD_THREADING_ENABLED // // If the platform has threads but no semapohores, // then we implement them ourselves using condition variables diff --git a/src/lib/IlmThread/IlmThreadSemaphoreOSX.cpp b/src/lib/IlmThread/IlmThreadSemaphoreOSX.cpp index ace45ef186..af635e66e1 100644 --- a/src/lib/IlmThread/IlmThreadSemaphoreOSX.cpp +++ b/src/lib/IlmThread/IlmThreadSemaphoreOSX.cpp @@ -39,7 +39,7 @@ // //----------------------------------------------------------------------------- -#if defined(__APPLE__) && !ILMBASE_HAVE_POSIX_SEMAPHORES +#if defined(__APPLE__) && !ILMTHREAD_HAVE_POSIX_SEMAPHORES #include "IlmThreadSemaphore.h" #include "Iex.h" diff --git a/src/lib/IlmThread/IlmThreadSemaphorePosix.cpp b/src/lib/IlmThread/IlmThreadSemaphorePosix.cpp index fe60078056..defaef7460 100644 --- a/src/lib/IlmThread/IlmThreadSemaphorePosix.cpp +++ b/src/lib/IlmThread/IlmThreadSemaphorePosix.cpp @@ -39,9 +39,9 @@ // //----------------------------------------------------------------------------- -#include "IlmBaseConfig.h" +#include "IlmThreadConfig.h" -#if ILMBASE_HAVE_POSIX_SEMAPHORES +#if ILMTHREAD_HAVE_POSIX_SEMAPHORES #include "IlmThreadSemaphore.h" #include "Iex.h" diff --git a/src/lib/IlmThread/IlmThreadSemaphorePosixCompat.cpp b/src/lib/IlmThread/IlmThreadSemaphorePosixCompat.cpp index a7b2549327..e8e71b35bc 100644 --- a/src/lib/IlmThread/IlmThreadSemaphorePosixCompat.cpp +++ b/src/lib/IlmThread/IlmThreadSemaphorePosixCompat.cpp @@ -39,10 +39,10 @@ // //----------------------------------------------------------------------------- -#include "IlmBaseConfig.h" +#include "IlmThreadConfig.h" -#if ILMBASE_THREADING_ENABLED -#if ( !(ILMBASE_HAVE_POSIX_SEMAPHORES) && !defined (__APPLE__) && !defined (_WIN32) && !defined (_WIN64) ) +#if ILMTHREAD_THREADING_ENABLED +#if ( !(ILMTHREAD_HAVE_POSIX_SEMAPHORES) && !defined (__APPLE__) && !defined (_WIN32) && !defined (_WIN64) ) #include "IlmThreadSemaphore.h" diff --git a/src/lib/IlmThread/IlmThreadSemaphoreWin32.cpp b/src/lib/IlmThread/IlmThreadSemaphoreWin32.cpp index c8d520a519..7d82424c8b 100644 --- a/src/lib/IlmThread/IlmThreadSemaphoreWin32.cpp +++ b/src/lib/IlmThread/IlmThreadSemaphoreWin32.cpp @@ -38,9 +38,9 @@ // //----------------------------------------------------------------------------- -#include "IlmBaseConfig.h" +#include "IlmThreadConfig.h" -#if (defined(_WIN32) || defined(_WIN64)) && !ILMBASE_HAVE_POSIX_SEMAPHORES +#if (defined(_WIN32) || defined(_WIN64)) && !ILMTHREAD_HAVE_POSIX_SEMAPHORES #include "IlmThreadSemaphore.h" #include "Iex.h" diff --git a/src/lib/OpenEXR/ImfAttribute.cpp b/src/lib/OpenEXR/ImfAttribute.cpp index 3e22776a67..c21518acb7 100644 --- a/src/lib/OpenEXR/ImfAttribute.cpp +++ b/src/lib/OpenEXR/ImfAttribute.cpp @@ -45,9 +45,9 @@ #include #include -#include +#include -#if ILMBASE_THREADING_ENABLED +#if ILMTHREAD_THREADING_ENABLED #include #endif @@ -79,7 +79,7 @@ class LockedTypeMap: public TypeMap { public: -#if ILMBASE_THREADING_ENABLED +#if ILMTHREAD_THREADING_ENABLED std::mutex mutex; #endif }; @@ -100,7 +100,7 @@ bool Attribute::knownType (const char typeName[]) { LockedTypeMap& tMap = typeMap(); -#if ILMBASE_THREADING_ENABLED +#if ILMTHREAD_THREADING_ENABLED std::lock_guard lock (tMap.mutex); #endif return tMap.find (typeName) != tMap.end(); @@ -112,7 +112,7 @@ Attribute::registerAttributeType (const char typeName[], Attribute *(*newAttribute)()) { LockedTypeMap& tMap = typeMap(); -#if ILMBASE_THREADING_ENABLED +#if ILMTHREAD_THREADING_ENABLED std::lock_guard lock (tMap.mutex); #endif if (tMap.find (typeName) != tMap.end()) @@ -128,7 +128,7 @@ void Attribute::unRegisterAttributeType (const char typeName[]) { LockedTypeMap& tMap = typeMap(); -#if ILMBASE_THREADING_ENABLED +#if ILMTHREAD_THREADING_ENABLED std::lock_guard lock (tMap.mutex); #endif tMap.erase (typeName); @@ -139,7 +139,7 @@ Attribute * Attribute::newAttribute (const char typeName[]) { LockedTypeMap& tMap = typeMap(); -#if ILMBASE_THREADING_ENABLED +#if ILMTHREAD_THREADING_ENABLED std::lock_guard lock (tMap.mutex); #endif TypeMap::const_iterator i = tMap.find (typeName); diff --git a/src/lib/OpenEXR/ImfDeepScanLineInputFile.cpp b/src/lib/OpenEXR/ImfDeepScanLineInputFile.cpp index 302b0d61df..47279988f6 100644 --- a/src/lib/OpenEXR/ImfDeepScanLineInputFile.cpp +++ b/src/lib/OpenEXR/ImfDeepScanLineInputFile.cpp @@ -194,7 +194,7 @@ LineBuffer::~LineBuffer () struct DeepScanLineInputFile::Data -#if ILMBASE_THREADING_ENABLED +#if ILMTHREAD_THREADING_ENABLED : public std::mutex #endif { @@ -1235,7 +1235,7 @@ DeepScanLineInputFile::version () const void DeepScanLineInputFile::setFrameBuffer (const DeepFrameBuffer &frameBuffer) { -#if ILMBASE_THREADING_ENABLED +#if ILMTHREAD_THREADING_ENABLED std::lock_guard lock (*_data->_streamData); #endif @@ -1370,7 +1370,7 @@ DeepScanLineInputFile::setFrameBuffer (const DeepFrameBuffer &frameBuffer) const DeepFrameBuffer & DeepScanLineInputFile::frameBuffer () const { -#if ILMBASE_THREADING_ENABLED +#if ILMTHREAD_THREADING_ENABLED std::lock_guard lock (*_data->_streamData); #endif return _data->frameBuffer; @@ -1389,7 +1389,7 @@ DeepScanLineInputFile::readPixels (int scanLine1, int scanLine2) { try { -#if ILMBASE_THREADING_ENABLED +#if ILMTHREAD_THREADING_ENABLED std::lock_guard lock (*_data->_streamData); #endif if (_data->slices.size() == 0) @@ -1545,7 +1545,7 @@ DeepScanLineInputFile::rawPixelData (int firstScanLine, THROW (IEX_NAMESPACE::InputExc, "Scan line " << minY << " is missing."); -#if ILMBASE_THREADING_ENABLED +#if ILMTHREAD_THREADING_ENABLED // enter the lock here - prevent another thread reseeking the file during read std::lock_guard lock (*_data->_streamData); #endif @@ -2089,7 +2089,7 @@ DeepScanLineInputFile::readPixelSampleCounts (int scanline1, int scanline2) try { -#if ILMBASE_THREADING_ENABLED +#if ILMTHREAD_THREADING_ENABLED std::lock_guard lock (*_data->_streamData); #endif savedFilePos = _data->_streamData->is->tellg(); diff --git a/src/lib/OpenEXR/ImfDeepScanLineOutputFile.cpp b/src/lib/OpenEXR/ImfDeepScanLineOutputFile.cpp index a16bb8fbf7..476fc4f261 100644 --- a/src/lib/OpenEXR/ImfDeepScanLineOutputFile.cpp +++ b/src/lib/OpenEXR/ImfDeepScanLineOutputFile.cpp @@ -987,7 +987,7 @@ DeepScanLineOutputFile::initialize (const Header &header) DeepScanLineOutputFile::~DeepScanLineOutputFile () { { -#if ILMBASE_THREADING_ENABLED +#if ILMTHREAD_THREADING_ENABLED std::lock_guard lock(*_data->_streamData); #endif Int64 originalPosition = _data->_streamData->os->tellp(); @@ -1048,7 +1048,7 @@ DeepScanLineOutputFile::header () const void DeepScanLineOutputFile::setFrameBuffer (const DeepFrameBuffer &frameBuffer) { -#if ILMBASE_THREADING_ENABLED +#if ILMTHREAD_THREADING_ENABLED std::lock_guard lock (*_data->_streamData); #endif // @@ -1168,7 +1168,7 @@ DeepScanLineOutputFile::setFrameBuffer (const DeepFrameBuffer &frameBuffer) const DeepFrameBuffer & DeepScanLineOutputFile::frameBuffer () const { -#if ILMBASE_THREADING_ENABLED +#if ILMTHREAD_THREADING_ENABLED std::lock_guard lock (*_data->_streamData); #endif return _data->frameBuffer; @@ -1180,7 +1180,7 @@ DeepScanLineOutputFile::writePixels (int numScanLines) { try { -#if ILMBASE_THREADING_ENABLED +#if ILMTHREAD_THREADING_ENABLED std::lock_guard lock (*_data->_streamData); #endif if (_data->slices.size() == 0) @@ -1404,7 +1404,7 @@ DeepScanLineOutputFile::writePixels (int numScanLines) int DeepScanLineOutputFile::currentScanLine () const { -#if ILMBASE_THREADING_ENABLED +#if ILMTHREAD_THREADING_ENABLED std::lock_guard lock (*_data->_streamData); #endif return _data->currentScanLine; @@ -1437,7 +1437,7 @@ union bytesOrInt64 void DeepScanLineOutputFile::copyPixels (DeepScanLineInputFile &in) { -#if ILMBASE_THREADING_ENABLED +#if ILMTHREAD_THREADING_ENABLED std::lock_guard lock (*_data->_streamData); #endif // @@ -1540,7 +1540,7 @@ DeepScanLineOutputFile::copyPixels (DeepScanLineInputFile &in) void DeepScanLineOutputFile::updatePreviewImage (const PreviewRgba newPixels[]) { -#if ILMBASE_THREADING_ENABLED +#if ILMTHREAD_THREADING_ENABLED std::lock_guard lock (*_data->_streamData); #endif if (_data->previewPosition <= 0) diff --git a/src/lib/OpenEXR/ImfDeepTiledInputFile.cpp b/src/lib/OpenEXR/ImfDeepTiledInputFile.cpp index 884c34ce9b..be89dbc28d 100644 --- a/src/lib/OpenEXR/ImfDeepTiledInputFile.cpp +++ b/src/lib/OpenEXR/ImfDeepTiledInputFile.cpp @@ -200,7 +200,7 @@ class MultiPartInputFile; // struct DeepTiledInputFile::Data -#if ILMBASE_THREADING_ENABLED +#if ILMTHREAD_THREADING_ENABLED : public std::mutex #endif { @@ -1114,7 +1114,7 @@ DeepTiledInputFile::version () const void DeepTiledInputFile::setFrameBuffer (const DeepFrameBuffer &frameBuffer) { -#if ILMBASE_THREADING_ENABLED +#if ILMTHREAD_THREADING_ENABLED std::lock_guard lock (*_data->_streamData); #endif // @@ -1263,7 +1263,7 @@ DeepTiledInputFile::setFrameBuffer (const DeepFrameBuffer &frameBuffer) const DeepFrameBuffer & DeepTiledInputFile::frameBuffer () const { -#if ILMBASE_THREADING_ENABLED +#if ILMTHREAD_THREADING_ENABLED std::lock_guard lock (*_data->_streamData); #endif return _data->frameBuffer; @@ -1286,7 +1286,7 @@ DeepTiledInputFile::readTiles (int dx1, int dx2, int dy1, int dy2, int lx, int l try { -#if ILMBASE_THREADING_ENABLED +#if ILMTHREAD_THREADING_ENABLED std::lock_guard lock (*_data->_streamData); #endif if (_data->slices.size() == 0) @@ -1432,7 +1432,7 @@ DeepTiledInputFile::rawTileData (int &dx, int &dy, lx << ", " << ly << ") is missing."); } -#if ILMBASE_THREADING_ENABLED +#if ILMTHREAD_THREADING_ENABLED std::lock_guard lock(*_data->_streamData); #endif if (_data->_streamData->is->tellg() != tileOffset) @@ -1741,7 +1741,7 @@ DeepTiledInputFile::readPixelSampleCounts (int dx1, int dx2, try { -#if ILMBASE_THREADING_ENABLED +#if ILMTHREAD_THREADING_ENABLED std::lock_guard lock (*_data->_streamData); #endif savedFilePos = _data->_streamData->is->tellg(); diff --git a/src/lib/OpenEXR/ImfDeepTiledOutputFile.cpp b/src/lib/OpenEXR/ImfDeepTiledOutputFile.cpp index 687f824d70..5b12c41a87 100644 --- a/src/lib/OpenEXR/ImfDeepTiledOutputFile.cpp +++ b/src/lib/OpenEXR/ImfDeepTiledOutputFile.cpp @@ -1264,7 +1264,7 @@ DeepTiledOutputFile::~DeepTiledOutputFile () if (_data) { { -#if ILMBASE_THREADING_ENABLED +#if ILMTHREAD_THREADING_ENABLED std::lock_guard lock(*_data->_streamData); #endif Int64 originalPosition = _data->_streamData->os->tellp(); @@ -1326,7 +1326,7 @@ DeepTiledOutputFile::header () const void DeepTiledOutputFile::setFrameBuffer (const DeepFrameBuffer &frameBuffer) { -#if ILMBASE_THREADING_ENABLED +#if ILMTHREAD_THREADING_ENABLED std::lock_guard lock (*_data->_streamData); #endif // @@ -1437,7 +1437,7 @@ DeepTiledOutputFile::setFrameBuffer (const DeepFrameBuffer &frameBuffer) const DeepFrameBuffer & DeepTiledOutputFile::frameBuffer () const { -#if ILMBASE_THREADING_ENABLED +#if ILMTHREAD_THREADING_ENABLED std::lock_guard lock (*_data->_streamData); #endif return _data->frameBuffer; @@ -1450,7 +1450,7 @@ DeepTiledOutputFile::writeTiles (int dx1, int dx2, int dy1, int dy2, { try { -#if ILMBASE_THREADING_ENABLED +#if ILMTHREAD_THREADING_ENABLED std::lock_guard lock (*_data->_streamData); #endif @@ -1722,7 +1722,7 @@ DeepTiledOutputFile::copyPixels (DeepTiledInputFile &in) int numAllTiles = in.totalTiles(); -#if ILMBASE_THREADING_ENABLED +#if ILMTHREAD_THREADING_ENABLED std::lock_guard lock (*_data->_streamData); #endif // @@ -1994,7 +1994,7 @@ DeepTiledOutputFile::isValidTile (int dx, int dy, int lx, int ly) const void DeepTiledOutputFile::updatePreviewImage (const PreviewRgba newPixels[]) { -#if ILMBASE_THREADING_ENABLED +#if ILMTHREAD_THREADING_ENABLED std::lock_guard lock (*_data->_streamData); #endif if (_data->previewPosition <= 0) @@ -2047,7 +2047,7 @@ DeepTiledOutputFile::breakTile int length, char c) { -#if ILMBASE_THREADING_ENABLED +#if ILMTHREAD_THREADING_ENABLED std::lock_guard lock (*_data->_streamData); #endif Int64 position = _data->tileOffsets (dx, dy, lx, ly); diff --git a/src/lib/OpenEXR/ImfHeader.cpp b/src/lib/OpenEXR/ImfHeader.cpp index 32eb381395..6c31208693 100644 --- a/src/lib/OpenEXR/ImfHeader.cpp +++ b/src/lib/OpenEXR/ImfHeader.cpp @@ -69,7 +69,7 @@ #include #include #include -#include +#include #include "Iex.h" #include #include @@ -79,7 +79,7 @@ #include "ImfTiledMisc.h" #include "ImfNamespace.h" -#if ILMBASE_THREADING_ENABLED +#if ILMTHREAD_THREADING_ENABLED #include #endif @@ -1280,7 +1280,7 @@ Header::readFrom (OPENEXR_IMF_INTERNAL_NAMESPACE::IStream &is, int &version) void staticInitialize () { -#if ILMBASE_THREADING_ENABLED +#if ILMTHREAD_THREADING_ENABLED static std::mutex criticalSection; std::lock_guard lock (criticalSection); #endif diff --git a/src/lib/OpenEXR/ImfInputFile.cpp b/src/lib/OpenEXR/ImfInputFile.cpp index 323885e6c7..c708619a56 100644 --- a/src/lib/OpenEXR/ImfInputFile.cpp +++ b/src/lib/OpenEXR/ImfInputFile.cpp @@ -74,7 +74,7 @@ using IMATH_NAMESPACE::modp; // struct InputFile::Data -#if ILMBASE_THREADING_ENABLED +#if ILMTHREAD_THREADING_ENABLED : public std::mutex #endif { @@ -750,7 +750,7 @@ InputFile::setFrameBuffer (const FrameBuffer &frameBuffer) { if (_data->isTiled) { -#if ILMBASE_THREADING_ENABLED +#if ILMTHREAD_THREADING_ENABLED std::lock_guard lock (*_data); #endif // @@ -887,7 +887,7 @@ InputFile::frameBuffer () const } else if(_data->isTiled) { -#if ILMBASE_THREADING_ENABLED +#if ILMTHREAD_THREADING_ENABLED std::lock_guard lock (*_data); #endif return _data->tFileBuffer; @@ -931,7 +931,7 @@ InputFile::readPixels (int scanLine1, int scanLine2) } else if (_data->isTiled) { -#if ILMBASE_THREADING_ENABLED +#if ILMTHREAD_THREADING_ENABLED std::lock_guard lock (*_data); #endif bufferedReadPixels (_data, scanLine1, scanLine2); diff --git a/src/lib/OpenEXR/ImfInputStreamMutex.h b/src/lib/OpenEXR/ImfInputStreamMutex.h index 21683881fd..55cf5e6afa 100644 --- a/src/lib/OpenEXR/ImfInputStreamMutex.h +++ b/src/lib/OpenEXR/ImfInputStreamMutex.h @@ -38,9 +38,9 @@ #include "ImfIO.h" #include "ImfNamespace.h" -#include "IlmBaseConfig.h" +#include "IlmThreadConfig.h" -#if ILMBASE_THREADING_ENABLED +#if ILMTHREAD_THREADING_ENABLED #include #endif @@ -50,7 +50,7 @@ OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER // Used to wrap OPENEXR_IMF_INTERNAL_NAMESPACE::IStream as a mutex. // struct InputStreamMutex -#if ILMBASE_THREADING_ENABLED +#if ILMTHREAD_THREADING_ENABLED : public std::mutex #endif { diff --git a/src/lib/OpenEXR/ImfMultiPartInputFile.cpp b/src/lib/OpenEXR/ImfMultiPartInputFile.cpp index 020ea5b2e1..29b6ac3a90 100644 --- a/src/lib/OpenEXR/ImfMultiPartInputFile.cpp +++ b/src/lib/OpenEXR/ImfMultiPartInputFile.cpp @@ -180,7 +180,7 @@ template T* MultiPartInputFile::getInputPart(int partNumber) { -#if ILMBASE_THREADING_ENABLED +#if ILMTHREAD_THREADING_ENABLED std::lock_guard lock(*_data); #endif if (_data->_inputFiles.find(partNumber) == _data->_inputFiles.end()) @@ -196,7 +196,7 @@ MultiPartInputFile::getInputPart(int partNumber) void MultiPartInputFile::flushPartCache() { -#if ILMBASE_THREADING_ENABLED +#if ILMTHREAD_THREADING_ENABLED std::lock_guard lock(*_data); #endif while ( _data->_inputFiles.begin() != _data->_inputFiles.end()) diff --git a/src/lib/OpenEXR/ImfMultiPartOutputFile.cpp b/src/lib/OpenEXR/ImfMultiPartOutputFile.cpp index 7da5de18cb..3f967bc175 100644 --- a/src/lib/OpenEXR/ImfMultiPartOutputFile.cpp +++ b/src/lib/OpenEXR/ImfMultiPartOutputFile.cpp @@ -321,7 +321,7 @@ template T* MultiPartOutputFile::getOutputPart(int partNumber) { -#if ILMBASE_THREADING_ENABLED +#if ILMTHREAD_THREADING_ENABLED std::lock_guard lock(*_data); #endif if (_data->_outputFiles.find(partNumber) == _data->_outputFiles.end()) diff --git a/src/lib/OpenEXR/ImfOutputFile.cpp b/src/lib/OpenEXR/ImfOutputFile.cpp index dcb8f2b99f..7349d1d4d3 100644 --- a/src/lib/OpenEXR/ImfOutputFile.cpp +++ b/src/lib/OpenEXR/ImfOutputFile.cpp @@ -861,7 +861,7 @@ OutputFile::~OutputFile () if (_data) { { -#if ILMBASE_THREADING_ENABLED +#if ILMTHREAD_THREADING_ENABLED std::lock_guard lock(*_data->_streamData); #endif Int64 originalPosition = _data->_streamData->os->tellp(); @@ -919,7 +919,7 @@ OutputFile::header () const void OutputFile::setFrameBuffer (const FrameBuffer &frameBuffer) { -#if ILMBASE_THREADING_ENABLED +#if ILMTHREAD_THREADING_ENABLED std::lock_guard lock (*_data->_streamData); #endif // @@ -1012,7 +1012,7 @@ OutputFile::setFrameBuffer (const FrameBuffer &frameBuffer) const FrameBuffer & OutputFile::frameBuffer () const { -#if ILMBASE_THREADING_ENABLED +#if ILMTHREAD_THREADING_ENABLED std::lock_guard lock (*_data->_streamData); #endif return _data->frameBuffer; @@ -1024,7 +1024,7 @@ OutputFile::writePixels (int numScanLines) { try { -#if ILMBASE_THREADING_ENABLED +#if ILMTHREAD_THREADING_ENABLED std::lock_guard lock (*_data->_streamData); #endif if (_data->slices.size() == 0) @@ -1248,7 +1248,7 @@ OutputFile::writePixels (int numScanLines) int OutputFile::currentScanLine () const { -#if ILMBASE_THREADING_ENABLED +#if ILMTHREAD_THREADING_ENABLED std::lock_guard lock (*_data->_streamData); #endif return _data->currentScanLine; @@ -1258,7 +1258,7 @@ OutputFile::currentScanLine () const void OutputFile::copyPixels (InputFile &in) { -#if ILMBASE_THREADING_ENABLED +#if ILMTHREAD_THREADING_ENABLED std::lock_guard lock (*_data->_streamData); #endif // @@ -1349,7 +1349,7 @@ OutputFile::copyPixels( InputPart & in) void OutputFile::updatePreviewImage (const PreviewRgba newPixels[]) { -#if ILMBASE_THREADING_ENABLED +#if ILMTHREAD_THREADING_ENABLED std::lock_guard lock (*_data->_streamData); #endif if (_data->previewPosition <= 0) @@ -1397,7 +1397,7 @@ OutputFile::updatePreviewImage (const PreviewRgba newPixels[]) void OutputFile::breakScanLine (int y, int offset, int length, char c) { -#if ILMBASE_THREADING_ENABLED +#if ILMTHREAD_THREADING_ENABLED std::lock_guard lock (*_data->_streamData); #endif Int64 position = diff --git a/src/lib/OpenEXR/ImfOutputStreamMutex.h b/src/lib/OpenEXR/ImfOutputStreamMutex.h index dbeff7c861..1a133d5bb9 100644 --- a/src/lib/OpenEXR/ImfOutputStreamMutex.h +++ b/src/lib/OpenEXR/ImfOutputStreamMutex.h @@ -39,9 +39,9 @@ #include "ImfGenericOutputFile.h" #include "ImfNamespace.h" -#include "IlmBaseConfig.h" +#include "IlmThreadConfig.h" -#if ILMBASE_THREADING_ENABLED +#if ILMTHREAD_THREADING_ENABLED #include #endif @@ -51,7 +51,7 @@ OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER // Used to wrap OPENEXR_IMF_INTERNAL_NAMESPACE::OStream as a Mutex. // struct OutputStreamMutex -#if ILMBASE_THREADING_ENABLED +#if ILMTHREAD_THREADING_ENABLED : public std::mutex #endif { diff --git a/src/lib/OpenEXR/ImfScanLineInputFile.cpp b/src/lib/OpenEXR/ImfScanLineInputFile.cpp index 54caec01d5..f372c0f8ba 100644 --- a/src/lib/OpenEXR/ImfScanLineInputFile.cpp +++ b/src/lib/OpenEXR/ImfScanLineInputFile.cpp @@ -208,7 +208,7 @@ struct sliceOptimizationData struct ScanLineInputFile::Data -#if ILMBASE_THREADING_ENABLED +#if ILMTHREAD_THREADING_ENABLED : public std::mutex #endif { @@ -1424,7 +1424,7 @@ detectOptimizationMode (const vector& optData) void ScanLineInputFile::setFrameBuffer (const FrameBuffer &frameBuffer) { -#if ILMBASE_THREADING_ENABLED +#if ILMTHREAD_THREADING_ENABLED std::lock_guard lock (*_streamData); #endif @@ -1630,7 +1630,7 @@ ScanLineInputFile::setFrameBuffer (const FrameBuffer &frameBuffer) const FrameBuffer & ScanLineInputFile::frameBuffer () const { -#if ILMBASE_THREADING_ENABLED +#if ILMTHREAD_THREADING_ENABLED std::lock_guard lock (*_streamData); #endif return _data->frameBuffer; @@ -1658,7 +1658,7 @@ ScanLineInputFile::readPixels (int scanLine1, int scanLine2) { try { -#if ILMBASE_THREADING_ENABLED +#if ILMTHREAD_THREADING_ENABLED std::lock_guard lock (*_streamData); #endif if (_data->slices.size() == 0) @@ -1783,7 +1783,7 @@ ScanLineInputFile::rawPixelData (int firstScanLine, { try { -#if ILMBASE_THREADING_ENABLED +#if ILMTHREAD_THREADING_ENABLED std::lock_guard lock (*_streamData); #endif if (firstScanLine < _data->minY || firstScanLine > _data->maxY) @@ -1821,7 +1821,7 @@ void ScanLineInputFile::rawPixelDataToBuffer(int scanLine, try { -#if ILMBASE_THREADING_ENABLED +#if ILMTHREAD_THREADING_ENABLED std::lock_guard lock (*_streamData); #endif if (scanLine < _data->minY || scanLine > _data->maxY) diff --git a/src/lib/OpenEXR/ImfTiledInputFile.cpp b/src/lib/OpenEXR/ImfTiledInputFile.cpp index e48d307b13..9efcc5a314 100644 --- a/src/lib/OpenEXR/ImfTiledInputFile.cpp +++ b/src/lib/OpenEXR/ImfTiledInputFile.cpp @@ -195,7 +195,7 @@ class MultiPartInputFile; // struct TiledInputFile::Data -#if ILMBASE_THREADING_ENABLED +#if ILMTHREAD_THREADING_ENABLED : public std::mutex #endif { @@ -1144,7 +1144,7 @@ TiledInputFile::version () const void TiledInputFile::setFrameBuffer (const FrameBuffer &frameBuffer) { -#if ILMBASE_THREADING_ENABLED +#if ILMTHREAD_THREADING_ENABLED std::lock_guard lock (*_data->_streamData); #endif // @@ -1264,7 +1264,7 @@ TiledInputFile::setFrameBuffer (const FrameBuffer &frameBuffer) const FrameBuffer & TiledInputFile::frameBuffer () const { -#if ILMBASE_THREADING_ENABLED +#if ILMTHREAD_THREADING_ENABLED std::lock_guard lock (*_data->_streamData); #endif return _data->frameBuffer; @@ -1287,7 +1287,7 @@ TiledInputFile::readTiles (int dx1, int dx2, int dy1, int dy2, int lx, int ly) try { -#if ILMBASE_THREADING_ENABLED +#if ILMTHREAD_THREADING_ENABLED std::lock_guard lock (*_data->_streamData); #endif if (_data->slices.size() == 0) @@ -1424,7 +1424,7 @@ TiledInputFile::rawTileData (int &dx, int &dy, { try { -#if ILMBASE_THREADING_ENABLED +#if ILMTHREAD_THREADING_ENABLED std::lock_guard lock (*_data->_streamData); #endif if (!isValidTile (dx, dy, lx, ly)) diff --git a/src/lib/OpenEXR/ImfTiledOutputFile.cpp b/src/lib/OpenEXR/ImfTiledOutputFile.cpp index 269e3cb901..977070c92b 100644 --- a/src/lib/OpenEXR/ImfTiledOutputFile.cpp +++ b/src/lib/OpenEXR/ImfTiledOutputFile.cpp @@ -71,7 +71,7 @@ #include "ImfNamespace.h" -#if ILMBASE_THREADING_ENABLED +#if ILMTHREAD_THREADING_ENABLED # include #endif @@ -1077,7 +1077,7 @@ TiledOutputFile::~TiledOutputFile () if (_data) { { -#if ILMBASE_THREADING_ENABLED +#if ILMTHREAD_THREADING_ENABLED std::lock_guard lock(*_streamData); #endif Int64 originalPosition = _streamData->os->tellp(); @@ -1134,7 +1134,7 @@ TiledOutputFile::header () const void TiledOutputFile::setFrameBuffer (const FrameBuffer &frameBuffer) { -#if ILMBASE_THREADING_ENABLED +#if ILMTHREAD_THREADING_ENABLED std::lock_guard lock (*_streamData); #endif // @@ -1217,7 +1217,7 @@ TiledOutputFile::setFrameBuffer (const FrameBuffer &frameBuffer) const FrameBuffer & TiledOutputFile::frameBuffer () const { -#if ILMBASE_THREADING_ENABLED +#if ILMTHREAD_THREADING_ENABLED std::lock_guard lock (*_streamData); #endif return _data->frameBuffer; @@ -1230,7 +1230,7 @@ TiledOutputFile::writeTiles (int dx1, int dx2, int dy1, int dy2, { try { -#if ILMBASE_THREADING_ENABLED +#if ILMTHREAD_THREADING_ENABLED std::lock_guard lock (*_streamData); #endif if (_data->slices.size() == 0) @@ -1442,7 +1442,7 @@ TiledOutputFile::writeTile (int dx, int dy, int l) void TiledOutputFile::copyPixels (TiledInputFile &in) { -#if ILMBASE_THREADING_ENABLED +#if ILMTHREAD_THREADING_ENABLED std::lock_guard lock (*_streamData); #endif // @@ -1798,7 +1798,7 @@ TiledOutputFile::isValidTile (int dx, int dy, int lx, int ly) const void TiledOutputFile::updatePreviewImage (const PreviewRgba newPixels[]) { -#if ILMBASE_THREADING_ENABLED +#if ILMTHREAD_THREADING_ENABLED std::lock_guard lock (*_streamData); #endif if (_data->previewPosition <= 0) @@ -1851,7 +1851,7 @@ TiledOutputFile::breakTile int length, char c) { -#if ILMBASE_THREADING_ENABLED +#if ILMTHREAD_THREADING_ENABLED std::lock_guard lock (*_streamData); #endif Int64 position = _data->tileOffsets (dx, dy, lx, ly); diff --git a/src/lib/OpenEXR/ImfTiledRgbaFile.cpp b/src/lib/OpenEXR/ImfTiledRgbaFile.cpp index b904d32654..5e69fe0254 100644 --- a/src/lib/OpenEXR/ImfTiledRgbaFile.cpp +++ b/src/lib/OpenEXR/ImfTiledRgbaFile.cpp @@ -52,7 +52,7 @@ #include "Iex.h" #include "ImfNamespace.h" -#if ILMBASE_THREADING_ENABLED +#if ILMTHREAD_THREADING_ENABLED #include #endif @@ -156,7 +156,7 @@ ywFromHeader (const Header &header) class TiledRgbaOutputFile::ToYa -#if ILMBASE_THREADING_ENABLED +#if ILMTHREAD_THREADING_ENABLED : public std::mutex #endif { @@ -398,7 +398,7 @@ TiledRgbaOutputFile::setFrameBuffer (const Rgba *base, { if (_toYa) { -#if ILMBASE_THREADING_ENABLED +#if ILMTHREAD_THREADING_ENABLED std::lock_guard lock (*_toYa); #endif _toYa->setFrameBuffer (base, xStride, yStride); @@ -607,7 +607,7 @@ TiledRgbaOutputFile::writeTile (int dx, int dy, int l) { if (_toYa) { -#if ILMBASE_THREADING_ENABLED +#if ILMTHREAD_THREADING_ENABLED std::lock_guard lock (*_toYa); #endif _toYa->writeTile (dx, dy, l, l); @@ -624,7 +624,7 @@ TiledRgbaOutputFile::writeTile (int dx, int dy, int lx, int ly) { if (_toYa) { -#if ILMBASE_THREADING_ENABLED +#if ILMTHREAD_THREADING_ENABLED std::lock_guard lock (*_toYa); #endif _toYa->writeTile (dx, dy, lx, ly); @@ -642,7 +642,7 @@ TiledRgbaOutputFile::writeTiles { if (_toYa) { -#if ILMBASE_THREADING_ENABLED +#if ILMTHREAD_THREADING_ENABLED std::lock_guard lock (*_toYa); #endif for (int dy = dyMin; dy <= dyMax; dy++) @@ -664,7 +664,7 @@ TiledRgbaOutputFile::writeTiles class TiledRgbaInputFile::FromYa -#if ILMBASE_THREADING_ENABLED +#if ILMTHREAD_THREADING_ENABLED : public std::mutex #endif { @@ -849,7 +849,7 @@ TiledRgbaInputFile::setFrameBuffer (Rgba *base, size_t xStride, size_t yStride) { if (_fromYa) { -#if ILMBASE_THREADING_ENABLED +#if ILMTHREAD_THREADING_ENABLED std::lock_guard lock (*_fromYa); #endif _fromYa->setFrameBuffer (base, xStride, yStride, _channelNamePrefix); @@ -1118,7 +1118,7 @@ TiledRgbaInputFile::readTile (int dx, int dy, int l) { if (_fromYa) { -#if ILMBASE_THREADING_ENABLED +#if ILMTHREAD_THREADING_ENABLED std::lock_guard lock (*_fromYa); #endif _fromYa->readTile (dx, dy, l, l); @@ -1135,7 +1135,7 @@ TiledRgbaInputFile::readTile (int dx, int dy, int lx, int ly) { if (_fromYa) { -#if ILMBASE_THREADING_ENABLED +#if ILMTHREAD_THREADING_ENABLED std::lock_guard lock (*_fromYa); #endif _fromYa->readTile (dx, dy, lx, ly); @@ -1153,7 +1153,7 @@ TiledRgbaInputFile::readTiles (int dxMin, int dxMax, int dyMin, int dyMax, { if (_fromYa) { -#if ILMBASE_THREADING_ENABLED +#if ILMTHREAD_THREADING_ENABLED std::lock_guard lock (*_fromYa); #endif for (int dy = dyMin; dy <= dyMax; dy++) diff --git a/src/test/OpenEXRTest/testMultiPartThreading.cpp b/src/test/OpenEXRTest/testMultiPartThreading.cpp index 876fa31467..f6e6019e97 100644 --- a/src/test/OpenEXRTest/testMultiPartThreading.cpp +++ b/src/test/OpenEXRTest/testMultiPartThreading.cpp @@ -63,7 +63,7 @@ #include #include -#if ILMBASE_THREADING_ENABLED +#if ILMTHREAD_THREADING_ENABLED #include #endif @@ -73,7 +73,7 @@ using namespace std; using namespace IMATH_NAMESPACE; using namespace ILMTHREAD_NAMESPACE; -#if ILMBASE_THREADING_ENABLED +#if ILMTHREAD_THREADING_ENABLED namespace { @@ -811,7 +811,7 @@ testWriteRead (int partNumber, } } // namespace -#endif // ILMBASE_THREADING_ENABLED +#endif // ILMTHREAD_THREADING_ENABLED void testMultiPartThreading (const std::string & tempDir) { @@ -824,7 +824,7 @@ void testMultiPartThreading (const std::string & tempDir) cout << " Threading not supported!" << endl << endl; return; } -#if ILMBASE_THREADING_ENABLED +#if ILMTHREAD_THREADING_ENABLED random_reseed(1); int numThreads = ThreadPool::globalThreadPool().numThreads(); diff --git a/src/test/OpenEXRTest/testSharedFrameBuffer.cpp b/src/test/OpenEXRTest/testSharedFrameBuffer.cpp index d4626b9f4a..f17232ec61 100644 --- a/src/test/OpenEXRTest/testSharedFrameBuffer.cpp +++ b/src/test/OpenEXRTest/testSharedFrameBuffer.cpp @@ -59,7 +59,7 @@ using namespace IMATH_NAMESPACE; using namespace ILMTHREAD_NAMESPACE; -#if ILMBASE_THREADING_ENABLED +#if ILMTHREAD_THREADING_ENABLED namespace { Rand48 rand1 (27); @@ -314,7 +314,7 @@ testSharedFrameBuffer (const std::string &tempDir) return; } -#if ILMBASE_THREADING_ENABLED +#if ILMTHREAD_THREADING_ENABLED const int W = 1371; const int H = 159;