Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make config.h more Autoconf friendly (GH #835) #836

Merged
merged 23 commits into from
May 17, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update comments
  • Loading branch information
noloader committed May 17, 2019
commit b34055457aac091af799962e551a46c9eca09949
4 changes: 3 additions & 1 deletion algparam.h
Original file line number Diff line number Diff line change
Expand Up @@ -320,10 +320,12 @@ class CRYPTOPP_DLL AlgorithmParametersBase
if (m_throwIfNotUsed && !m_used)
throw ParameterNotUsed(m_name);
}
#if !defined(CRYPTOPP_CXX17_EXCEPTIONS) && !defined(CRYPTOPP_UNCAUGHT_EXCEPTION_AVAILABLE)
#if !defined(CRYPTOPP_CXX17_EXCEPTIONS)
# if !defined(CRYPTOPP_UNCAUGHT_EXCEPTION_AVAILABLE)
catch(const Exception&)
{
}
# endif
#endif
}

Expand Down
20 changes: 8 additions & 12 deletions config_cxx.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
/// \since Crypto++ 8.3

// Visual Studio began at VS2010, http://msdn.microsoft.com/en-us/library/hh567368%28v=vs.110%29.aspx
// and https://docs.microsoft.com/en-us/cpp/visual-cpp-language-conformance .
// and https://docs.microsoft.com/en-us/cpp/visual-cpp-language-conformance
// Intel, http://software.intel.com/en-us/articles/c0x-features-supported-by-intel-c-compiler
// GCC, http://gcc.gnu.org/projects/cxx0x.html
// Clang, http://clang.llvm.org/cxx_status.html
Expand All @@ -25,6 +25,11 @@
#include "config_cpu.h"
#include "config_ver.h"

// Ancient Crypto++ define, dating back to C++98 and C++03.
#ifndef CRYPTOPP_DISABLE_UNCAUGHT_EXCEPTION
# define CRYPTOPP_UNCAUGHT_EXCEPTION_AVAILABLE 1
#endif

// Compatibility with non-clang compilers.
#ifndef __has_feature
# define __has_feature(x) 0
Expand Down Expand Up @@ -158,7 +163,8 @@
# define CRYPTOPP_CXX17_EXCEPTIONS 1
# endif
# endif
#elif (CRYPTOPP_MSC_VERSION >= 1900) || (__INTEL_COMPILER >= 1800) || (CRYPTOPP_GCC_VERSION >= 60000) || (__cpp_lib_uncaught_exceptions)
#elif (CRYPTOPP_MSC_VERSION >= 1900) || (__INTEL_COMPILER >= 1800) || \
(CRYPTOPP_GCC_VERSION >= 60000) || (__cpp_lib_uncaught_exceptions)
# define CRYPTOPP_CXX17_EXCEPTIONS 1
#endif // uncaught_exceptions compilers

Expand All @@ -181,14 +187,4 @@
# define NULLPTR NULL
#endif // CRYPTOPP_CXX11_NULLPTR

#ifndef CRYPTOPP_DISABLE_UNCAUGHT_EXCEPTION
# define CRYPTOPP_UNCAUGHT_EXCEPTION_AVAILABLE
#endif

// OK to comment the following out, but please report it so we can fix it.
// C++17 value taken from http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4567.pdf.
#if (defined(__cplusplus) && (__cplusplus >= 199711L) && (__cplusplus < 201402L)) && !defined(CRYPTOPP_UNCAUGHT_EXCEPTION_AVAILABLE)
# error "std::uncaught_exception is not available. This is likely a configuration error."
#endif

#endif // CRYPTOPP_CONFIG_CXX_H