summaryrefslogtreecommitdiff
path: root/stdcpp.h
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2019-02-04 07:18:51 -0500
committerJeffrey Walton <noloader@gmail.com>2019-02-04 07:18:51 -0500
commit47435f7d7203229cff6742a9ba46cad36def07c9 (patch)
treefe9678167c3f25730bf8e8b74548591aefa841da /stdcpp.h
parent5b6b86c7f14eb576b4836541c56b7dbdab18c4d7 (diff)
downloadcryptopp-git-47435f7d7203229cff6742a9ba46cad36def07c9.tar.gz
Guard use of <cstddef> for Microsoft compilers (GH #781)
Diffstat (limited to 'stdcpp.h')
-rw-r--r--stdcpp.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/stdcpp.h b/stdcpp.h
index a13fd25b..41dda240 100644
--- a/stdcpp.h
+++ b/stdcpp.h
@@ -60,11 +60,18 @@ namespace std {
#endif
#include <cstdlib>
-#include <cstddef>
#include <cstring>
#include <climits>
#include <cmath>
+// It is 2019 and VS2017/Win10 still can't compile a
+// program that includes <cstddef> without making users
+// do something special. "Epic fail" comes to mind.
+// Also see https://github.com/weidai11/cryptopp/issues/781
+#ifndef _MSC_VER
+# include <cstddef>
+#endif
+
// uintptr_t and ptrdiff_t
#if defined(__SUNPRO_CC)
# if (__SUNPRO_CC >= 0x5100)