From ada2aaf17996d8e46312538fce63e21d66e5b0be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Wed, 24 Jul 2024 09:19:09 +0200 Subject: [PATCH 1/3] Fix redefinition warning in modern MSVC Fix warning shown when compiling using modern C standards instead of MSVC legacy (which is still the default). --- lib/xlsxio_write.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/xlsxio_write.c b/lib/xlsxio_write.c index 73bf0fb..178873f 100644 --- a/lib/xlsxio_write.c +++ b/lib/xlsxio_write.c @@ -47,7 +47,9 @@ typedef struct zip_source zip_source_t; #if defined(_MSC_VER) # undef DLL_EXPORT_XLSXIO # define DLL_EXPORT_XLSXIO -# define va_copy(dst,src) ((dst) = (src)) +# ifndef va_copy +# define va_copy(dst,src) ((dst) = (src)) +# endif #endif #ifdef _WIN32 From 50689bd08dc00a636a1e039f3c3f42058d5b7997 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Wed, 24 Jul 2024 09:19:38 +0200 Subject: [PATCH 2/3] Explicitly cast to time_t to avoid MSVC warning --- lib/xlsxio_read.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/xlsxio_read.c b/lib/xlsxio_read.c index 0c8b0dd..b1ccd26 100644 --- a/lib/xlsxio_read.c +++ b/lib/xlsxio_read.c @@ -1625,7 +1625,7 @@ DLL_EXPORT_XLSXIO int xlsxioread_sheet_next_cell_datetime (xlsxioreadersheet she if (value != 0) { value = (value - 25569) * 86400; //conversion from Excel to Unix timestamp } - *pvalue = value; + *pvalue = (time_t)value; } free(result); return 1; From 45ff9b1ac75139620c5c18eec78e6c58ce5f0f9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Wed, 24 Jul 2024 09:21:34 +0200 Subject: [PATCH 3/3] Fix src/xlsxio_write_main.c compilation --- src/xlsxio_write_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/xlsxio_write_main.c b/src/xlsxio_write_main.c index ec97039..5aaa6c6 100644 --- a/src/xlsxio_write_main.c +++ b/src/xlsxio_write_main.c @@ -8,7 +8,7 @@ int main (int argc, char* argv[]) if (argc <= 1) return 0; unlink(argv[1]); - if ((handle = xlsxiowrite_open(argv[1])) == NULL) { + if ((handle = xlsxiowrite_open(argv[1], NULL)) == NULL) { fprintf(stderr, "Error creating zip file\n"); return 1; }