Skip to content

Commit 857c54e

Browse files
committed
[any, time_t] fix mingw build
1 parent 8be5db8 commit 857c54e

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

include/itlib/any.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ namespace anyimpl {
6767
struct default_allocator {
6868
void* allocate_bytes(std::size_t n, std::size_t a) {
6969
void* ret =
70-
#if defined(_MSC_VER)
70+
#if defined(_WIN32)
7171
_aligned_malloc(n, a);
7272
#else
7373
aligned_alloc(a, n);
@@ -76,7 +76,7 @@ struct default_allocator {
7676
return ret;
7777
}
7878
void deallocate_bytes(void* p, std::size_t /*n*/, std::size_t /*a*/) noexcept {
79-
#if defined(_MSC_VER)
79+
#if defined(_WIN32)
8080
_aligned_free(p);
8181
#else
8282
free(p);

include/itlib/time_t.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ class time_t
135135
{
136136
std::tm ret = {};
137137
auto mt = std::time_t(*this);
138-
#if defined(_MSC_VER)
138+
#if defined(_WIN32)
139139
gmtime_s(&ret, &mt);
140140
#else
141141
gmtime_r(&mt, &ret);
@@ -147,7 +147,7 @@ class time_t
147147
{
148148
std::tm ret = {};
149149
auto mt = std::time_t(*this);
150-
#if defined(_MSC_VER)
150+
#if defined(_WIN32)
151151
localtime_s(&ret, &mt);
152152
#else
153153
localtime_r(&mt, &ret);

test/t-time_t-11.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ TEST_CASE("[time_t] tm")
6262
CHECK(lt.tm_year == 101);
6363
CHECK((lt.tm_wday == 0 || lt.tm_wday == 1));
6464

65-
#if !defined(__APPLE__)
65+
#if !defined(__APPLE__) && !defined(__MINGW32__)
6666
// macs have some weird problem with std::locale
6767
// but I don't have the time (or patience) to debug it now :)
6868
std::locale::global(std::locale("en_US.UTF8"));

0 commit comments

Comments
 (0)