diff options
author | lloyd <[email protected]> | 2014-05-15 03:09:41 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2014-05-15 03:09:41 +0000 |
commit | 9ac0b0612ea36dd9a2e850745238c20ee6b0444f (patch) | |
tree | a1c04fbd0734ad11d86f4553e36e844d016363e6 /src | |
parent | 318b0e20fa1edd2dc700a01e47d31ebb8c219460 (diff) |
VC2013 doesn't support __func__. Github #22
Diffstat (limited to 'src')
-rw-r--r-- | src/build-data/buildh.in | 6 | ||||
-rw-r--r-- | src/lib/utils/assert.h | 8 |
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) |