aboutsummaryrefslogtreecommitdiffstats
path: root/src/utils
diff options
context:
space:
mode:
authorlloyd <lloyd@randombit.net>2010-11-29 22:52:17 +0000
committerlloyd <lloyd@randombit.net>2010-11-29 22:52:17 +0000
commit0e41e0e8d441ff907f092c718db650cda06e2e1a (patch)
tree8c0df20500bdf601d4378a6000923501a48ad1f3 /src/utils
parent5d4621b745ac529c7df6c4d91e4d2b68bd0325e4 (diff)
parent65ab36776317f73ddf0f2d3bd6c1c7e35608962f (diff)
propagate from branch 'net.randombit.botan' (head fc8daa606ab7954eab48778d7236986747b719e4)
to branch 'net.randombit.botan.c++0x' (head 2bf71b0a2e0e468d7eb3631e4ca284234f554729)
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/assert.h26
-rw-r--r--src/utils/cpuid.cpp2
2 files changed, 19 insertions, 9 deletions
diff --git a/src/utils/assert.h b/src/utils/assert.h
index d84f5c7ad..67ca665e3 100644
--- a/src/utils/assert.h
+++ b/src/utils/assert.h
@@ -16,14 +16,24 @@ void assertion_failure(const char* expr_str,
const char* file,
int line);
-#define BOTAN_ASSERT(expr, msg) \
- do { \
- if(!(expr)) \
- Botan::assertion_failure(#expr, \
- msg, \
- BOTAN_ASSERT_FUNCTION, \
- __FILE__, \
- __LINE__); \
+#define BOTAN_ASSERT(expr, msg) \
+ do { \
+ if(!(expr)) \
+ Botan::assertion_failure(#expr, \
+ msg, \
+ BOTAN_ASSERT_FUNCTION, \
+ __FILE__, \
+ __LINE__); \
+ } while(0)
+
+#define BOTAN_ASSERT_EQUAL(value1, value2, msg) \
+ do { \
+ if(value1 != value2) \
+ Botan::assertion_failure(#value1 " == " #value2, \
+ msg, \
+ BOTAN_ASSERT_FUNCTION, \
+ __FILE__, \
+ __LINE__); \
} while(0)
/*
diff --git a/src/utils/cpuid.cpp b/src/utils/cpuid.cpp
index c34a99942..30f441bd0 100644
--- a/src/utils/cpuid.cpp
+++ b/src/utils/cpuid.cpp
@@ -26,7 +26,7 @@
#include <ia32intrin.h>
#define CALL_CPUID(type, out) do { __cpuid(out, type); } while(0);
-#elif BOTAN_GCC_VERSION >= 430
+#elif (BOTAN_GCC_VERSION >= 430) || defined(BOTAN_BUILD_COMPILER_IS_CLANG)
// Only available starting in GCC 4.3
#include <cpuid.h>