aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/utils
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2015-11-16 16:56:28 -0500
committerJack Lloyd <[email protected]>2015-11-16 16:56:28 -0500
commit9da0769c946cf7904745ed562a8c595806f29464 (patch)
tree80a5cc6126d62e2370909513c1eaaceef63f1889 /src/lib/utils
parente2480dedcabf44fcc41641785c81bcafb16727fc (diff)
Remove mul128.h header from public view
The only reason mul128.h was included in mp_types.h was for the definition of dword. But dword is only needed by the generic version of mp_madd, which is an internal header. So move both the inclusion of the header and the dword definition to there. Previously mul128.h was very public (mp_types.h to bigint.h to rsa.h, for example) and use of __int128 causes problems in pedantic mode. So additionally, prefer using the TI attribute version since GCC does not complain about that. Clang's -Wpedantic does not seem to care about it either way. GH #330
Diffstat (limited to 'src/lib/utils')
-rw-r--r--src/lib/utils/mul128.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/lib/utils/mul128.h b/src/lib/utils/mul128.h
index 3ad7dbcdb..bcf5fa7ef 100644
--- a/src/lib/utils/mul128.h
+++ b/src/lib/utils/mul128.h
@@ -1,6 +1,6 @@
/*
* 64x64->128 bit multiply operation
-* (C) 2013 Jack Lloyd
+* (C) 2013,2015 Jack Lloyd
*
* Botan is released under the Simplified BSD License (see license.txt)
*/
@@ -12,13 +12,13 @@
namespace Botan {
-#if defined(__SIZEOF_INT128__)
- #define BOTAN_TARGET_HAS_NATIVE_UINT128
- typedef unsigned __int128 uint128_t;
-
-#elif (BOTAN_GCC_VERSION > 440) && defined(BOTAN_TARGET_CPU_HAS_NATIVE_64BIT)
+// Prefer TI mode over __int128 as GCC rejects the latter in pendantic mode
+#if (BOTAN_GCC_VERSION > 440) && defined(BOTAN_TARGET_CPU_HAS_NATIVE_64BIT)
#define BOTAN_TARGET_HAS_NATIVE_UINT128
typedef unsigned int uint128_t __attribute__((mode(TI)));
+#elif defined(__SIZEOF_INT128__)
+ #define BOTAN_TARGET_HAS_NATIVE_UINT128
+ typedef unsigned __int128 uint128_t;
#endif
}