Fix Visual Studio compilation with _HAS_EXCEPTIONS=0
Bug information: https://connect.microsoft.com/VisualStudio/feedback/details/1600701/type-info-does-not-compile-with-has-exceptions-0 For example: ``` C:\Work\github\cryptopp>cl /c /Tp cryptlib.h /Focryptlib.h.obj /D_HAS_EXCEPTIONS=0 Microsoft (R) C/C++ Optimizing Compiler Version 18.00.31101 for x86 Copyright (C) Microsoft Corporation. All rights reserved. sha.h c:\work\github\cryptopp\cryptlib.h(292) : error C2039: 'type_info' : is not a member of 'std' c:\work\github\cryptopp\cryptlib.h(298) : error C2039: 'type_info' : is not a member of 'std' c:\work\github\cryptopp\cryptlib.h(302) : error C2039: 'type_info' : is not a member of 'std' c:\work\github\cryptopp\cryptlib.h(305) : error C2039: 'type_info' : is not a member of 'std' c:\work\github\cryptopp\cryptlib.h(306) : error C2039: 'type_info' : is not a member of 'std' c:\work\github\cryptopp\cryptlib.h(392) : error C2039: 'type_info' : is not a member of 'std' c:\work\github\cryptopp\cryptlib.h(437) : error C2039: 'type_info' : is not a member of 'std' ```pull/152/head
parent
34a34967ac
commit
9b5894be39
7
stdcpp.h
7
stdcpp.h
|
|
@ -6,6 +6,13 @@
|
|||
#include <intrin.h>
|
||||
#endif
|
||||
|
||||
#ifdef _MSC_VER
|
||||
// Workaround for: https://connect.microsoft.com/VisualStudio/feedback/details/1600701/type-info-does-not-compile-with-has-exceptions-0
|
||||
namespace std {
|
||||
using ::type_info;
|
||||
}
|
||||
#endif
|
||||
|
||||
#include <string>
|
||||
#include <memory>
|
||||
#include <exception>
|
||||
|
|
|
|||
Loading…
Reference in New Issue