diff options
author | 2016-08-06 14:20:16 +0200 | |
---|---|---|
committer | 2016-08-06 14:20:16 +0200 | |
commit | 3917850b6197950e5671f4d3b9cb0b9c921b798d (patch) | |
tree | 503b9690868a7c238ba10d73b5c6bece7ca8c338 /3rdparty/bx/tests/vector_nodefault.cpp | |
parent | 057474989c1a92e9e935dbc8cb9d233ba3a4ea3a (diff) |
Update BX and BGFX (nw)
Diffstat (limited to '3rdparty/bx/tests/vector_nodefault.cpp')
-rw-r--r-- | 3rdparty/bx/tests/vector_nodefault.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/3rdparty/bx/tests/vector_nodefault.cpp b/3rdparty/bx/tests/vector_nodefault.cpp index 4a8bc8cf1dd..1340b0c0b3d 100644 --- a/3rdparty/bx/tests/vector_nodefault.cpp +++ b/3rdparty/bx/tests/vector_nodefault.cpp @@ -33,10 +33,14 @@ #include <string.h> #include <stdlib.h> +#if !BX_CRT_MSVC +# define _strdup strdup +#endif // !BX_CRT_MSVC + struct nodefault { - nodefault(const char* s) { data = strdup(s); } + nodefault(const char* s) { data = _strdup(s); } ~nodefault() { free(data); } - nodefault(const nodefault& other) { data = 0; if (other.data) data = strdup(other.data); } + nodefault(const nodefault& other) { data = 0; if (other.data) data = _strdup(other.data); } nodefault& operator=(const nodefault& other) { nodefault(other).swap(*this); return *this; } void swap(nodefault& other) { std::swap(data, other.data); } @@ -148,7 +152,7 @@ TEST(vector_nodefault_popback) { v.push_back("24"); CHECK(v.back() == "24"); - + v.pop_back(); CHECK(v.back() == "12"); |