Skip to content

Commit 7ef3dac

Browse files
authored
Remove C++11 constexpr code for CRYPTOPP_ALIGN_DATA (PR weidai11#830)
I don't have faith in it even though it has tested good so far.
1 parent ff544c3 commit 7ef3dac

File tree

4 files changed

+4
-13
lines changed

4 files changed

+4
-13
lines changed

blake2.cpp

+1-4
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,10 @@
4444
#endif
4545

4646
// Can't use GetAlignmentOf<word64>() because of C++11 and constexpr
47-
// Can use 'const unsigned int' because of MSVC
47+
// Can use 'const unsigned int' because of MSVC 2013
4848
#if (CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X64)
4949
# define ALIGN_SPEC32 16
5050
# define ALIGN_SPEC64 16
51-
#elif (CRYPTOPP_CXX11_ALIGNOF)
52-
# define ALIGN_SPEC32 alignof(CryptoPP::word32)
53-
# define ALIGN_SPEC64 alignof(CryptoPP::word64)
5451
#else
5552
# define ALIGN_SPEC32 4
5653
# define ALIGN_SPEC64 8

donna_32.cpp

+1-3
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,9 @@ extern const char DONNA32_FNAME[] = __FILE__;
4040
ANONYMOUS_NAMESPACE_BEGIN
4141

4242
// Can't use GetAlignmentOf<word32>() because of C++11 and constexpr
43-
// Can use 'const unsigned int' because of MSVC
43+
// Can use 'const unsigned int' because of MSVC 2013
4444
#if (CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X64)
4545
# define ALIGN_SPEC 16
46-
#elif (CRYPTOPP_CXX11_ALIGNOF)
47-
# define ALIGN_SPEC alignof(CryptoPP::word32)
4846
#else
4947
# define ALIGN_SPEC 4
5048
#endif

donna_64.cpp

+1-3
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,9 @@ extern const char DONNA64_FNAME[] = __FILE__;
4040
ANONYMOUS_NAMESPACE_BEGIN
4141

4242
// Can't use GetAlignmentOf<word64>() because of C++11 and constexpr
43-
// Can use 'const unsigned int' because of MSVC
43+
// Can use 'const unsigned int' because of MSVC 2013
4444
#if (CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X64)
4545
# define ALIGN_SPEC 16
46-
#elif (CRYPTOPP_CXX11_ALIGNOF)
47-
# define ALIGN_SPEC alignof(CryptoPP::word64)
4846
#else
4947
# define ALIGN_SPEC 8
5048
#endif

salsa.cpp

+1-3
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,9 @@
2929
ANONYMOUS_NAMESPACE_BEGIN
3030

3131
// Can't use GetAlignmentOf<word32>() because of C++11 and constexpr
32-
// Can use 'const unsigned int' because of MSVC
32+
// Can use 'const unsigned int' because of MSVC 2013
3333
#if (CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X64)
3434
# define ALIGN_SPEC 16
35-
#elif (CRYPTOPP_CXX11_ALIGNOF)
36-
# define ALIGN_SPEC alignof(CryptoPP::word32)
3735
#else
3836
# define ALIGN_SPEC 4
3937
#endif

0 commit comments

Comments
 (0)