From 9ad9a8bec0c8ff43af754e9215d73737d30308ed Mon Sep 17 00:00:00 2001 From: Jack Lloyd Date: Sat, 30 Jul 2016 10:01:45 -0400 Subject: Check for __SIZEOF_INT128__ before using TI mode Otherwise we run into problems on 64-bit CPUs with 32-bit userland. GH #563 --- src/lib/utils/mul128.h | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/lib/utils/mul128.h b/src/lib/utils/mul128.h index bcf5fa7ef..fe533c720 100644 --- a/src/lib/utils/mul128.h +++ b/src/lib/utils/mul128.h @@ -12,13 +12,15 @@ namespace Botan { -// 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) +#if defined(__SIZEOF_INT128__) && 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; + + // Prefer TI mode over __int128 as GCC rejects the latter in pendantic mode + #if defined(__GNUG__) + typedef unsigned int uint128_t __attribute__((mode(TI))); + #else + typedef unsigned __int128 uint128_t; + #endif #endif } -- cgit v1.2.3 From bca8bef636823abfb4b81fea82df943d4f4499a5 Mon Sep 17 00:00:00 2001 From: Jack Lloyd Date: Sat, 30 Jul 2016 10:03:03 -0400 Subject: Use stat instead of lstat in get_files_recursive. Otherwise symlinked files are ignored. GH #565 --- src/lib/utils/filesystem.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/lib/utils/filesystem.cpp b/src/lib/utils/filesystem.cpp index 8d51e64bd..c67668288 100644 --- a/src/lib/utils/filesystem.cpp +++ b/src/lib/utils/filesystem.cpp @@ -90,7 +90,7 @@ std::vector impl_readdir(const std::string& dir_path) struct stat stat_buf; - if(::lstat(full_path.c_str(), &stat_buf) == -1) + if(::stat(full_path.c_str(), &stat_buf) == -1) continue; if(S_ISDIR(stat_buf.st_mode)) -- cgit v1.2.3