diff options
Diffstat (limited to 'extra/yassl/include/yassl_types.hpp')
-rw-r--r-- | extra/yassl/include/yassl_types.hpp | 30 |
1 files changed, 18 insertions, 12 deletions
diff --git a/extra/yassl/include/yassl_types.hpp b/extra/yassl/include/yassl_types.hpp index c73a54a7c15..a9e22833eb1 100644 --- a/extra/yassl/include/yassl_types.hpp +++ b/extra/yassl/include/yassl_types.hpp @@ -26,7 +26,6 @@ #define yaSSL_TYPES_HPP #include <stddef.h> -#include <assert.h> #include "type_traits.hpp" @@ -37,6 +36,13 @@ #endif +#ifdef _MSC_VER + // disable conversion warning + // 4996 warning to use MS extensions e.g., strcpy_s instead of strncpy + #pragma warning(disable:4244 4996) +#endif + + namespace yaSSL { #define YASSL_LIB @@ -63,29 +69,29 @@ namespace yaSSL { template<typename T> void ysDelete(T* ptr) { - if (ptr) ptr->~T(); - ::operator delete(ptr, yaSSL::ys); + if (ptr) ptr->~T(); + ::operator delete(ptr, yaSSL::ys); } template<typename T> void ysArrayDelete(T* ptr) { - // can't do array placement destruction since not tracking size in - // allocation, only allow builtins to use array placement since they - // don't need destructors called - typedef char builtin[TaoCrypt::IsFundamentalType<T>::Yes ? 1 : -1]; - (void)sizeof(builtin); + // can't do array placement destruction since not tracking size in + // allocation, only allow builtins to use array placement since they + // don't need destructors called + typedef char builtin[TaoCrypt::IsFundamentalType<T>::Yes ? 1 : -1]; + (void)sizeof(builtin); - ::operator delete[](ptr, yaSSL::ys); + ::operator delete[](ptr, yaSSL::ys); } #define NEW_YS new (yaSSL::ys) // to resolve compiler generated operator delete on base classes with - // virtual destructors (when on stack), make sure doesn't get called + // virtual destructors (when on stack) class virtual_base { public: - static void operator delete(void*) { assert(0); } + static void operator delete(void*) { } }; @@ -124,7 +130,7 @@ typedef opaque byte; typedef unsigned int uint; - + #ifdef USE_SYS_STL // use system STL #define STL_VECTOR_FILE <vector> |