Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IMATH_NOEXCEPT macro to make noexcept a compile-time option #157

Merged
merged 6 commits into from
Jun 4, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions config/ImathConfig.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,21 @@
// IMATH_LIB_VERSION is the library API version: SOCURRENT.SOAGE.SOREVISION
#define IMATH_LIB_VERSION_STRING "@IMATH_LIB_VERSION@"

//
// Code that depends on the v2 ExcMath mechanism of signal handlers
// that throw exceptions is incompatible with noexcept, since
// floating-point overflow and underflow can occur in a wide variety
// of computations within Imath functions now marked with
// noexcept. Code that needs to accomodate the exception-handling
// behavior can build with the IMATH_USE_NOEXCEPT off.
//

#cmakedefine01 IMATH_USE_NOEXCEPT
#if IMATH_USE_NOEXCEPT
#define IMATH_NOEXCEPT noexcept
#else
#define IMATH_NOEXCEPT
#endif

//
// By default, opt into the interoparability constructors and assignments.
Expand Down
3 changes: 3 additions & 0 deletions config/ImathSetup.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ option(IMATH_USE_DEFAULT_VISIBILITY "Makes the compile use default visibility (b
# object (if you enable this) that contains a LUT of the function
option(IMATH_ENABLE_LARGE_STACK "Enables code to take advantage of large stack support" OFF)

# Option to make it possible to build without the noexcept specifier
option(IMATH_USE_NOEXCEPT "Compile with noexcept specifier" ON)

# What C++ standard to compile for. VFX Platform 18 is c++14, so
# that's the default.
set(tmp 14)
Expand Down
4 changes: 2 additions & 2 deletions docs/Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ PREDEFINED = IMATH_CONSTEXPR14=constexpr \
IMATH_INTERNAL_NAMESPACE_SOURCE_EXIT="}" \
IMATH_INTERNAL_NAMESPACE_HEADER_ENTER="namespace Imath {" \
IMATH_INTERNAL_NAMESPACE_HEADER_EXIT="}" \
IMATH_NOEXCEPT="noexcept" \
IMATH_EXPORT= \
IMATH_EXPORT_ENUM= \
IMATH_EXPORT_TYPE= \
IMATH_EXPORT_TEMPLATE_TYPE= \
__cplusplus=1

__cplusplus=1
Loading