summaryrefslogtreecommitdiff
path: root/stdcpp.h
diff options
context:
space:
mode:
authorweidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0>2010-06-18 07:06:59 +0000
committerweidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0>2010-06-18 07:06:59 +0000
commite562437c88d18d206d079aa0ed07f5be57203a4a (patch)
tree2c3909fc3181e50ef34814d62769b02277bc13a5 /stdcpp.h
parent70a991f0023a3bd23bfd6ffd0b665f1dbed701bf (diff)
downloadcryptopp-e562437c88d18d206d079aa0ed07f5be57203a4a.tar.gz
fix possible race condition in Singleton::Ref()
tolerate double destruction of Singleton and g_nullNameValuePairs fix #include of standard headers git-svn-id: svn://svn.code.sf.net/p/cryptopp/code/trunk/c5@488 57ff6487-cd31-0410-9ec3-f628ee90f5f0
Diffstat (limited to 'stdcpp.h')
-rw-r--r--stdcpp.h18
1 files changed, 11 insertions, 7 deletions
diff --git a/stdcpp.h b/stdcpp.h
index 9a468ab..234bf54 100644
--- a/stdcpp.h
+++ b/stdcpp.h
@@ -4,24 +4,28 @@
#include <stddef.h>
#include <assert.h>
#include <limits.h>
+#include <stdlib.h>
+#include <string.h>
#include <memory>
#include <string>
#include <exception>
#include <typeinfo>
-
-
-#ifdef _MSC_VER
-#include <string.h> // CodeWarrior doesn't have memory.h
#include <algorithm>
#include <map>
#include <vector>
-// re-disable this
-#pragma warning(disable: 4231)
+// for alloca
+#ifdef __sun
+#include <alloca.h>
+#elif defined(__MINGW32__)
+#include <malloc.h>
#endif
-#if defined(_MSC_VER) && defined(_CRTAPI1)
+#ifdef _MSC_VER
+#pragma warning(disable: 4231) // re-disable this
+#ifdef _CRTAPI1
#define CRYPTOPP_MSVCRT6
#endif
+#endif
#endif