Skip to content

Commit a046d24

Browse files
committed
Add CRYPTOPP_CXX11_INITIALIZER_LIST
1 parent fdb977a commit a046d24

File tree

3 files changed

+20
-0
lines changed

3 files changed

+20
-0
lines changed
+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#include <vector>
2+
int main(int argc, char* argv[])
3+
{
4+
std::vector<int> v{0,1,2,3,4};
5+
return 0;
6+
}

TestScripts/configure.sh

+7
Original file line numberDiff line numberDiff line change
@@ -709,6 +709,13 @@ rm -f config_cxx.h.new
709709
echo '// #define CRYPTOPP_CXX11_ALIGNOF 1'
710710
fi
711711

712+
CXX_RESULT=$(${CXX} ${CXXFLAGS} TestPrograms/test_cxx11_initializer.cxx -o ${TOUT} 2>&1 | tr ' ' '\n' | wc -l)
713+
if [[ "${CXX_RESULT}" -eq 0 ]]; then
714+
echo '#define CRYPTOPP_CXX11_INITIALIZER_LIST 1'
715+
else
716+
echo '// #define CRYPTOPP_CXX11_INITIALIZER_LIST 1'
717+
fi
718+
712719
CXX_RESULT=$(${CXX} ${CXXFLAGS} TestPrograms/test_cxx11_lambda.cxx -o ${TOUT} 2>&1 | tr ' ' '\n' | wc -l)
713720
if [[ "${CXX_RESULT}" -eq 0 ]]; then
714721
echo '#define CRYPTOPP_CXX11_LAMBDA 1'

config_cxx.h

+7
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,13 @@
149149
# define CRYPTOPP_CXX11_ALIGNOF 1
150150
#endif // alignof
151151

152+
// initializer lists: MS at VS2013 (18.00); GCC at 4.4; Clang at 3.1; Intel 14.0; SunCC 5.13.
153+
#if (CRYPTOPP_MSC_VERSION >= 1800) || (CRYPTOPP_LLVM_CLANG_VERSION >= 30100) || \
154+
(CRYPTOPP_APPLE_CLANG_VERSION >= 40000) || (__INTEL_COMPILER >= 1400) || \
155+
(CRYPTOPP_GCC_VERSION >= 40400) || (__SUNPRO_CC >= 0x5130)
156+
# define CRYPTOPP_CXX11_INITIALIZER_LIST 1
157+
#endif // alignas
158+
152159
// lambdas: MS at VS2012 (17.00); GCC at 4.9; Clang at 3.3; Intel 12.0; SunCC 5.14.
153160
#if (CRYPTOPP_MSC_VERSION >= 1700) || __has_feature(cxx_lambdas) || \
154161
(__INTEL_COMPILER >= 1200) || (CRYPTOPP_GCC_VERSION >= 40900) || (__SUNPRO_CC >= 0x5140)

0 commit comments

Comments
 (0)