summaryrefslogtreecommitdiff
path: root/config.h
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2016-06-15 05:02:28 -0400
committerJeffrey Walton <noloader@gmail.com>2016-06-15 05:02:28 -0400
commitb1df5736a7191eb14adb178cfff2c8ea3daf638e (patch)
treed18d41684bffd32728ca36838ed4576c2102e7d1 /config.h
parenta4f90454f8b8c385efedb60d27a22ed39ca60090 (diff)
downloadcryptopp-git-b1df5736a7191eb14adb178cfff2c8ea3daf638e.tar.gz
Merge 'solaris' dev branch into 'master'
Diffstat (limited to 'config.h')
-rw-r--r--config.h35
1 files changed, 29 insertions, 6 deletions
diff --git a/config.h b/config.h
index d502437d..9fa466ef 100644
--- a/config.h
+++ b/config.h
@@ -404,6 +404,12 @@ NAMESPACE_END
# define CRYPTOPP_DISABLE_ASM
#endif
+// Sun Studio 12 provides GCC inline assembly, http://blogs.oracle.com/x86be/entry/gcc_style_asm_inlining_support
+// We can enable SSE2 for Sun Studio in the makefile with -D__SSE2__, but users may not compile with it.
+#if !defined(CRYPTOPP_DISABLE_ASM) && defined(__x86_64__) && (__SUNPRO_CC >= 0x5100) && !defined(__SSE2__)
+# define __SSE2__ 1
+#endif
+
#if !defined(CRYPTOPP_DISABLE_ASM) && ((defined(_MSC_VER) && defined(_M_IX86)) || (defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))))
// C++Builder 2010 does not allow "call label" where label is defined within inline assembly
#define CRYPTOPP_X86_ASM_AVAILABLE
@@ -417,7 +423,7 @@ NAMESPACE_END
// SSE3 was actually introduced in GNU as 2.17, which was released 6/23/2006, but we can't tell what version of binutils is installed.
// GCC 4.1.2 was released on 2/13/2007, so we'll use that as a proxy for the binutils version. Also see the output of
// `gcc -dM -E -march=native - < /dev/null | grep -i SSE` for preprocessor defines available.
- #if !defined(CRYPTOPP_DISABLE_SSSE3) && (_MSC_VER >= 1400 || CRYPTOPP_GCC_VERSION >= 40102 || defined(__SSSE3__) || defined(__SSE3__))
+ #if !defined(CRYPTOPP_DISABLE_SSSE3) && (_MSC_VER >= 1400 || CRYPTOPP_GCC_VERSION >= 40102 || defined(__SSSE3__))
#define CRYPTOPP_BOOL_SSSE3_ASM_AVAILABLE 1
#else
#define CRYPTOPP_BOOL_SSSE3_ASM_AVAILABLE 0
@@ -746,7 +752,7 @@ NAMESPACE_END
// C++11 or C++14 is available
#if defined(CRYPTOPP_CXX11)
-// atomics: MS at VS2012 (17.00); GCC at 4.4; Clang at 3.1/3.2; and Intel 13.0.
+// atomics: MS at VS2012 (17.00); GCC at 4.4; Clang at 3.1/3.2; Intel 13.0; SunCC 12.5.
#if (CRYPTOPP_MSC_VERSION >= 1700)
# define CRYPTOPP_CXX11_ATOMICS 1
#elif defined(__INTEL_COMPILER) && (__INTEL_COMPILER >= 1300)
@@ -757,9 +763,11 @@ NAMESPACE_END
# endif
#elif (CRYPTOPP_GCC_VERSION >= 40400)
# define CRYPTOPP_CXX11_ATOMICS 1
+#elif (__SUNPRO_CC >= 0x5140)
+# define CRYPTOPP_CXX11_ATOMICS 1
#endif // atomics
-// synchronization: MS at VS2012 (17.00); GCC at 4.4; Clang at 3.3; Xcode 5.0; and Intel 12.0.
+// synchronization: MS at VS2012 (17.00); GCC at 4.4; Clang at 3.3; Xcode 5.0; Intel 12.0; SunCC 12.4.
// TODO: verify Clang and Intel versions; find __has_feature(x) extension for Clang
#if (CRYPTOPP_MSC_VERSION >= 1700)
# define CRYPTOPP_CXX11_SYNCHRONIZATION 1
@@ -769,9 +777,11 @@ NAMESPACE_END
# define CRYPTOPP_CXX11_SYNCHRONIZATION 1
#elif (CRYPTOPP_GCC_VERSION >= 40400)
# define CRYPTOPP_CXX11_SYNCHRONIZATION 1
+#elif (__SUNPRO_CC >= 0x5130)
+# define CRYPTOPP_CXX11_SYNCHRONIZATION 1
#endif // synchronization
-// alignof/alignas: MS at VS2015 (19.00); GCC at 4.8; Clang at 3.3; and Intel 15.0.
+// alignof/alignas: MS at VS2015 (19.00); GCC at 4.8; Clang at 3.3; Intel 15.0; SunCC 12.4.
#if (CRYPTOPP_MSC_VERSION >= 1900)
# define CRYPTOPP_CXX11_ALIGNAS 1
# define CRYPTOPP_CXX11_ALIGNOF 1
@@ -788,9 +798,12 @@ NAMESPACE_END
#elif (CRYPTOPP_GCC_VERSION >= 40800)
# define CRYPTOPP_CXX11_ALIGNAS 1
# define CRYPTOPP_CXX11_ALIGNOF 1
+#elif (__SUNPRO_CC >= 0x5130)
+# define CRYPTOPP_CXX11_ALIGNAS 1
+# define CRYPTOPP_CXX11_ALIGNOF 1
#endif // alignof/alignas
-// noexcept: MS at VS2015 (19.00); GCC at 4.6; Clang at 3.0; and Intel 14.0.
+// noexcept: MS at VS2015 (19.00); GCC at 4.6; Clang at 3.0; Intel 14.0; SunCC 12.4.
#if (CRYPTOPP_MSC_VERSION >= 1900)
# define CRYPTOPP_CXX11_NOEXCEPT 1
#elif defined(__INTEL_COMPILER) && (__INTEL_COMPILER >= 1400)
@@ -801,9 +814,11 @@ NAMESPACE_END
# endif
#elif (CRYPTOPP_GCC_VERSION >= 40600)
# define CRYPTOPP_CXX11_NOEXCEPT 1
+#elif (__SUNPRO_CC >= 0x5130)
+# define CRYPTOPP_CXX11_NOEXCEPT 1
#endif // noexcept compilers
-// variadic templates: MS at VS2013 (18.00); GCC at 4.3; Clang at 2.9; and Intel 12.1.
+// variadic templates: MS at VS2013 (18.00); GCC at 4.3; Clang at 2.9; Intel 12.1; SunCC 12.4.
#if (CRYPTOPP_MSC_VERSION >= 1800)
# define CRYPTOPP_CXX11_VARIADIC_TEMPLATES 1
#elif defined(__INTEL_COMPILER) && (__INTEL_COMPILER >= 1210)
@@ -814,6 +829,8 @@ NAMESPACE_END
# endif
#elif (CRYPTOPP_GCC_VERSION >= 40300)
# define CRYPTOPP_CXX11_VARIADIC_TEMPLATES 1
+#elif (__SUNPRO_CC >= 0x5130)
+# define CRYPTOPP_CXX11_VARIADIC_TEMPLATES 1
#endif // variadic templates
// TODO: Emplacement, R-values and Move semantics
@@ -821,6 +838,12 @@ NAMESPACE_END
#endif // CRYPTOPP_CXX11
+// Hack... CRYPTOPP_ALIGN_DATA is defined earlier, before C++11 alignas available
+#if defined(CRYPTOPP_CXX11_ALIGNAS)
+# undef CRYPTOPP_ALIGN_DATA
+# define CRYPTOPP_ALIGN_DATA(x) alignas(x)
+#endif // CRYPTOPP_CXX11_ALIGNAS
+
#if defined(CRYPTOPP_CXX11_NOEXCEPT)
# define CRYPTOPP_THROW noexcept(false)
# define CRYPTOPP_NO_THROW noexcept(true)