2018-01-23 22:47:19 +00:00
|
|
|
// stdcpp.h - originally written and placed in the public domain by Wei Dai
|
|
|
|
|
|
|
|
/// \file stdcpp.h
|
|
|
|
/// \brief Common C++ header files
|
|
|
|
|
2015-11-05 06:59:46 +00:00
|
|
|
#ifndef CRYPTOPP_STDCPP_H
|
|
|
|
#define CRYPTOPP_STDCPP_H
|
|
|
|
|
|
|
|
#if _MSC_VER >= 1500
|
|
|
|
#define _DO_NOT_DECLARE_INTERLOCKED_INTRINSICS_IN_MEMORY
|
|
|
|
#include <intrin.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
#include <memory>
|
|
|
|
#include <exception>
|
|
|
|
#include <typeinfo>
|
2015-11-18 20:32:28 +00:00
|
|
|
#include <algorithm>
|
2015-11-05 06:59:46 +00:00
|
|
|
#include <functional>
|
|
|
|
#include <utility>
|
|
|
|
#include <vector>
|
|
|
|
#include <limits>
|
2015-11-18 20:32:28 +00:00
|
|
|
#include <deque>
|
|
|
|
#include <list>
|
2015-11-05 06:59:46 +00:00
|
|
|
#include <map>
|
|
|
|
#include <new>
|
|
|
|
|
2016-10-01 16:04:57 +00:00
|
|
|
// http://connect.microsoft.com/VisualStudio/feedback/details/1600701/type-info-does-not-compile-with-has-exceptions-0
|
2016-04-06 07:42:04 +00:00
|
|
|
#if defined(_MSC_VER) && (_MSC_VER < 1900) && defined(_HAS_EXCEPTIONS) && (_HAS_EXCEPTIONS == 0)
|
|
|
|
namespace std {
|
|
|
|
using ::type_info;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2018-11-22 01:19:06 +00:00
|
|
|
// workaround needed for IBM XLC and debug heaps on AIX
|
|
|
|
#if defined(_AIX) && (defined(__xlc__) || defined(__xlC__) || defined(__ibmxl__))
|
2018-11-22 02:04:20 +00:00
|
|
|
# if defined(__DEBUG_ALLOC__)
|
2018-11-22 01:19:06 +00:00
|
|
|
namespace std {
|
2018-11-22 02:04:20 +00:00
|
|
|
using ::_debug_memset;
|
|
|
|
using ::_debug_memcpy;
|
2018-11-22 01:19:06 +00:00
|
|
|
}
|
2018-11-22 02:04:20 +00:00
|
|
|
# endif
|
2018-11-22 01:19:06 +00:00
|
|
|
#endif
|
|
|
|
|
2016-10-01 16:04:57 +00:00
|
|
|
// make_unchecked_array_iterator
|
2015-11-18 20:32:28 +00:00
|
|
|
#if _MSC_VER >= 1600
|
|
|
|
#include <iterator>
|
2015-11-05 06:59:46 +00:00
|
|
|
#endif
|
|
|
|
|
2016-05-03 04:23:05 +00:00
|
|
|
#if defined(CRYPTOPP_CXX11_ATOMICS)
|
|
|
|
#include <atomic>
|
|
|
|
#endif
|
|
|
|
|
2016-06-07 02:08:04 +00:00
|
|
|
#if defined(CRYPTOPP_CXX11_SYNCHRONIZATION)
|
|
|
|
#include <mutex>
|
|
|
|
#endif
|
|
|
|
|
2016-10-02 02:12:08 +00:00
|
|
|
#if defined(CRYPTOPP_CXX11_RVALUES)
|
|
|
|
# include <utility>
|
|
|
|
#endif
|
|
|
|
|
2015-11-05 06:59:46 +00:00
|
|
|
#include <cstdlib>
|
|
|
|
#include <cstddef>
|
|
|
|
#include <cstring>
|
|
|
|
#include <climits>
|
2017-10-13 01:52:23 +00:00
|
|
|
#include <cmath>
|
2016-09-30 05:09:21 +00:00
|
|
|
|
|
|
|
// uintptr_t and ptrdiff_t
|
2018-07-21 10:15:40 +00:00
|
|
|
#if defined(__SUNPRO_CC)
|
|
|
|
# if (__SUNPRO_CC >= 0x5100)
|
|
|
|
# include <stdint.h>
|
|
|
|
# endif
|
|
|
|
#elif defined(_MSC_VER)
|
|
|
|
# if (_MSC_VER >= 1700)
|
|
|
|
# include <stdint.h>
|
|
|
|
# else
|
|
|
|
# include <stddef.h>
|
|
|
|
# endif
|
|
|
|
#elif (__cplusplus < 201103L)
|
2016-09-30 05:09:21 +00:00
|
|
|
# include <stdint.h>
|
|
|
|
#endif
|
2015-11-05 06:59:46 +00:00
|
|
|
|
|
|
|
// workaround needed on Sun Studio 12u1 Sun C++ 5.10 SunOS_i386 128229-02 2009/09/21
|
2016-10-01 16:04:57 +00:00
|
|
|
#ifdef CRYPTOPP_INCLUDE_VECTOR_CC
|
|
|
|
# include <vector.cc>
|
2015-11-05 06:59:46 +00:00
|
|
|
#endif
|
|
|
|
|
2017-12-30 20:16:27 +00:00
|
|
|
// C++Builder's standard library (Dinkumware) do not have C's global log() function
|
|
|
|
// https://github.com/weidai11/cryptopp/issues/520
|
|
|
|
#ifdef __BORLANDC__
|
|
|
|
using std::log;
|
|
|
|
#endif
|
|
|
|
|
2018-11-22 01:19:06 +00:00
|
|
|
#endif // CRYPTOPP_STDCPP_H
|