diff options
Diffstat (limited to 'libs')
| -rw-r--r-- | libs/ImGuiDatePicker/ImGuiDatePicker.cpp | 5 | ||||
| -rw-r--r-- | libs/xml.c/src/xml.c | 20 | ||||
| -rw-r--r-- | libs/xml.c/src/xml.h | 1 | ||||
| -rw-r--r-- | libs/zip/src/miniz.h | 6 |
4 files changed, 22 insertions, 10 deletions
diff --git a/libs/ImGuiDatePicker/ImGuiDatePicker.cpp b/libs/ImGuiDatePicker/ImGuiDatePicker.cpp index 207a902..c69c8ba 100644 --- a/libs/ImGuiDatePicker/ImGuiDatePicker.cpp +++ b/libs/ImGuiDatePicker/ImGuiDatePicker.cpp @@ -4,6 +4,7 @@ #include <chrono> #include <vector> #include <unordered_map> +#include <time.h> #define GET_DAY(timePoint) int(timePoint.tm_mday) @@ -152,7 +153,11 @@ namespace ImGui std::time_t currentTime = std::chrono::system_clock::to_time_t(now); tm res; + #ifdef win64 gmtime_s(&res, ¤tTime); + #else + gmtime_r(¤tTime, &res); + #endif return res; } diff --git a/libs/xml.c/src/xml.c b/libs/xml.c/src/xml.c index 6d14213..0b435cd 100644 --- a/libs/xml.c/src/xml.c +++ b/libs/xml.c/src/xml.c @@ -320,11 +320,11 @@ static void xml_parser_error(struct xml_parser* parser, enum xml_parser_offset o int row = 0; int column = 0; - //#define min(X,Y) ((X) < (Y) ? (X) : (Y)) - //#define max(X,Y) ((X) > (Y) ? (X) : (Y)) + #define min(X,Y) ((X) < (Y) ? (X) : (Y)) + #define max(X,Y) ((X) > (Y) ? (X) : (Y)) size_t character = max(0, min(parser->length, parser->position + offset)); - //#undef min - //#undef max + #undef min + #undef max size_t position = 0; for (; position < character; ++position) { column++; @@ -1140,9 +1140,9 @@ void xml_string_copy(struct xml_string* string, uint8_t* buffer, size_t length) return; } - //#define min(X,Y) ((X) < (Y) ? (X) : (Y)) + #define min(X,Y) ((X) < (Y) ? (X) : (Y)) length = min(length, string->length); - //#undef min + #undef min memcpy(buffer, string->buffer, length); } @@ -1328,5 +1328,11 @@ time_t xml_get_date_x(struct xml_node* root, char* child_name, ...) time_t result = mktime(&tm_info); if (result == -1) return 0; - else return result - _timezone; + else { + #ifdef win64 + return result - _timezone; + #else + return result - timezone; + #endif + } }
\ No newline at end of file diff --git a/libs/xml.c/src/xml.h b/libs/xml.c/src/xml.h index ef8d55c..43e7f0f 100644 --- a/libs/xml.c/src/xml.h +++ b/libs/xml.c/src/xml.h @@ -31,6 +31,7 @@ #include <stdint.h> #include <stdio.h> #include <string.h> +#include <time.h> #ifdef __cplusplus extern "C" { diff --git a/libs/zip/src/miniz.h b/libs/zip/src/miniz.h index b3c3237..ac7f4d3 100644 --- a/libs/zip/src/miniz.h +++ b/libs/zip/src/miniz.h @@ -1,8 +1,8 @@ #ifndef MINIZ_EXPORT #define MINIZ_EXPORT -__pragma(warning(push)) -__pragma(warning(disable:4127)) +//__pragma(warning(push)) +//__pragma(warning(disable:4127)) #endif /* miniz.c 3.0.2 - public domain deflate/inflate, zlib-subset, ZIP @@ -10204,7 +10204,7 @@ mz_bool mz_zip_end(mz_zip_archive *pZip) { return MZ_FALSE; } -__pragma(warning(pop)) +//__pragma(warning(pop)) #ifdef __cplusplus } |
