aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/build-data/buildh.in6
-rw-r--r--src/lib/utils/assert.h8
2 files changed, 10 insertions, 4 deletions
diff --git a/src/build-data/buildh.in b/src/build-data/buildh.in
index 6172af247..636552a4f 100644
--- a/src/build-data/buildh.in
+++ b/src/build-data/buildh.in
@@ -113,6 +113,12 @@
#endif
+#if defined(_MSC_VER)
+ #define BOTAN_CURRENT_FUNCTION __FUNCTION__
+#else
+ #define BOTAN_CURRENT_FUNCTION __func__
+#endif
+
#if !defined(BOTAN_DEPRECATED)
#define BOTAN_DEPRECATED(msg)
#endif
diff --git a/src/lib/utils/assert.h b/src/lib/utils/assert.h
index f62fae63e..6117a460d 100644
--- a/src/lib/utils/assert.h
+++ b/src/lib/utils/assert.h
@@ -29,7 +29,7 @@ void BOTAN_DLL assertion_failure(const char* expr_str,
if(!(expr)) \
Botan::assertion_failure(#expr, \
assertion_made, \
- __func__, \
+ BOTAN_CURRENT_FUNCTION, \
__FILE__, \
__LINE__); \
} while(0)
@@ -42,7 +42,7 @@ void BOTAN_DLL assertion_failure(const char* expr_str,
if((expr1) != (expr2)) \
Botan::assertion_failure(#expr1 " == " #expr2, \
assertion_made, \
- __func__, \
+ BOTAN_CURRENT_FUNCTION, \
__FILE__, \
__LINE__); \
} while(0)
@@ -55,7 +55,7 @@ void BOTAN_DLL assertion_failure(const char* expr_str,
if((expr1) && !(expr2)) \
Botan::assertion_failure(#expr1 " implies " #expr2, \
msg, \
- __func__, \
+ BOTAN_CURRENT_FUNCTION, \
__FILE__, \
__LINE__); \
} while(0)
@@ -68,7 +68,7 @@ void BOTAN_DLL assertion_failure(const char* expr_str,
if(static_cast<bool>(ptr) == false) \
Botan::assertion_failure(#ptr " is not null", \
"", \
- __func__, \
+ BOTAN_CURRENT_FUNCTION, \
__FILE__, \
__LINE__); \
} while(0)