diff options
author | practicalswift <practicalswift@users.noreply.github.com> | 2019-03-04 14:55:44 +0100 |
---|---|---|
committer | practicalswift <practicalswift@users.noreply.github.com> | 2019-03-05 11:19:32 +0100 |
commit | c7a7250302b60b78af39f39ee403d330c0cb7aa0 (patch) | |
tree | 196f491a812843918270d7d590bbbe28ea408a4d /src/compat | |
parent | c7ea8d3236e7c1b0c198345cc78a6754338d3724 (diff) |
Document assumptions about C++ compiler
Diffstat (limited to 'src/compat')
-rw-r--r-- | src/compat/assumptions.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/compat/assumptions.h b/src/compat/assumptions.h index 0d39f66dbd..6e7b4d3ded 100644 --- a/src/compat/assumptions.h +++ b/src/compat/assumptions.h @@ -17,6 +17,17 @@ # error "Bitcoin cannot be compiled without assertions." #endif +// Assumption: We assume a C++11 (ISO/IEC 14882:2011) compiler (minimum requirement). +// Example(s): We assume the presence of C++11 features everywhere :-) +// Note: MSVC does not report the expected __cplusplus value due to legacy +// reasons. +#if !defined(_MSC_VER) +// ISO Standard C++11 [cpp.predefined]p1: +// "The name __cplusplus is defined to the value 201103L when compiling a C++ +// translation unit." +static_assert(__cplusplus >= 201103L, "C++11 standard assumed"); +#endif + // Assumption: We assume the floating-point types to fulfill the requirements of // IEC 559 (IEEE 754) standard. // Example(s): Floating-point division by zero in ConnectBlock, CreateTransaction |