Skip to content

Commit

Permalink
Disable automatic detection of CRYPTOPP_BOOL_SSE4_INTRINSICS_AVAILABL…
Browse files Browse the repository at this point in the history
…E for SunCC. Remove #error for C++17 (Issue 222)
  • Loading branch information
noloader committed Jul 12, 2016
1 parent b9232e0 commit ebef1f4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
9 changes: 6 additions & 3 deletions config.h
Expand Up @@ -396,6 +396,7 @@ NAMESPACE_END
# pragma GCC diagnostic ignored "-Wunused-function"
#endif

// TODO: Figure out C++17 and lack of std::uncaught_exception
#if (defined(_MSC_VER) && _MSC_VER <= 1300) || defined(__MWERKS__) || (defined(_STLPORT_VERSION) && ((_STLPORT_VERSION < 0x450) || defined(_STLP_NO_UNCAUGHT_EXCEPT_SUPPORT)))
#define CRYPTOPP_DISABLE_UNCAUGHT_EXCEPTION
#endif
Expand Down Expand Up @@ -456,8 +457,9 @@ NAMESPACE_END

// Intrinsics availible in GCC 4.3 (http://gcc.gnu.org/gcc-4.3/changes.html) and
// MSVC 2008 (http://msdn.microsoft.com/en-us/library/bb892950%28v=vs.90%29.aspx)
// SunCC could generate SSE4 at 12.1, but the intrinsics are missing until 12.4.
#if !defined(CRYPTOPP_DISABLE_SSE2) && !defined(CRYPTOPP_DISABLE_SSE4) && (((_MSC_VER >= 1500) && !defined(_M_ARM)) || defined(__SSE4_2__) || (__SUNPRO_CC >= 0x5130))
// SunCC could generate SSE4 at 12.1, but the intrinsics are missing until 12.4. However, we don't know
// when to activate the code paths because SunCC does not indicate it in the preprocessor with macros.
#if !defined(CRYPTOPP_DISABLE_SSE2) && !defined(CRYPTOPP_DISABLE_SSE4) && (((_MSC_VER >= 1500) && !defined(_M_ARM)) || (defined(__SSE4_1__) && defined(__SSE4_2__)))
#define CRYPTOPP_BOOL_SSE4_INTRINSICS_AVAILABLE 1
#else
#define CRYPTOPP_BOOL_SSE4_INTRINSICS_AVAILABLE 0
Expand Down Expand Up @@ -870,7 +872,8 @@ NAMESPACE_END
#endif // CRYPTOPP_CXX11_ALIGNAS

// OK to comment the following out, but please report it so we can fix it.
#if (defined(__cplusplus) && (__cplusplus >= 199711L)) && !defined(CRYPTOPP_UNCAUGHT_EXCEPTION_AVAILABLE)
// C++17 value taken from http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4567.pdf.
#if (defined(__cplusplus) && (__cplusplus >= 199711L) && (__cplusplus < 201402L)) && !defined(CRYPTOPP_UNCAUGHT_EXCEPTION_AVAILABLE)
# error "std::uncaught_exception is not available. This is likely a configuration error."
#endif

Expand Down
9 changes: 6 additions & 3 deletions config.recommend
Expand Up @@ -396,6 +396,7 @@ NAMESPACE_END
# pragma GCC diagnostic ignored "-Wunused-function"
#endif

// TODO: Figure out C++17 and lack of std::uncaught_exception
#if (defined(_MSC_VER) && _MSC_VER <= 1300) || defined(__MWERKS__) || (defined(_STLPORT_VERSION) && ((_STLPORT_VERSION < 0x450) || defined(_STLP_NO_UNCAUGHT_EXCEPT_SUPPORT)))
#define CRYPTOPP_DISABLE_UNCAUGHT_EXCEPTION
#endif
Expand Down Expand Up @@ -456,8 +457,9 @@ NAMESPACE_END

// Intrinsics availible in GCC 4.3 (http://gcc.gnu.org/gcc-4.3/changes.html) and
// MSVC 2008 (http://msdn.microsoft.com/en-us/library/bb892950%28v=vs.90%29.aspx)
// SunCC could generate SSE4 at 12.1, but the intrinsics are missing until 12.4.
#if !defined(CRYPTOPP_DISABLE_SSE2) && !defined(CRYPTOPP_DISABLE_SSE4) && (((_MSC_VER >= 1500) && !defined(_M_ARM)) || defined(__SSE4_2__) || (__SUNPRO_CC >= 0x5130))
// SunCC could generate SSE4 at 12.1, but the intrinsics are missing until 12.4. However, we don't know
// when to activate the code paths because SunCC does not indicate it in the preprocessor with macros.
#if !defined(CRYPTOPP_DISABLE_SSE2) && !defined(CRYPTOPP_DISABLE_SSE4) && (((_MSC_VER >= 1500) && !defined(_M_ARM)) || (defined(__SSE4_1__) && defined(__SSE4_2__)))
#define CRYPTOPP_BOOL_SSE4_INTRINSICS_AVAILABLE 1
#else
#define CRYPTOPP_BOOL_SSE4_INTRINSICS_AVAILABLE 0
Expand Down Expand Up @@ -870,7 +872,8 @@ NAMESPACE_END
#endif // CRYPTOPP_CXX11_ALIGNAS

// OK to comment the following out, but please report it so we can fix it.
#if (defined(__cplusplus) && (__cplusplus >= 199711L)) && !defined(CRYPTOPP_UNCAUGHT_EXCEPTION_AVAILABLE)
// C++17 value taken from http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4567.pdf.
#if (defined(__cplusplus) && (__cplusplus >= 199711L) && (__cplusplus < 201402L)) && !defined(CRYPTOPP_UNCAUGHT_EXCEPTION_AVAILABLE)
# error "std::uncaught_exception is not available. This is likely a configuration error."
#endif

Expand Down

0 comments on commit ebef1f4

Please sign in to comment.