Skip to content

Commit 0e85c52

Browse files
committed
[PBCKP-245] mingw: ucrt strftime is good enough
msvcrt's strftime is quite limited, and we had to use pg_strftime. On the other hand, ucrt's one is capable for most of SU (Single UNIX) extensions, so we could safely use it. That means, we restrict windows port to MinGW64 UCRT environment.
1 parent 085b99f commit 0e85c52

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/pg_probackup.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@
4343

4444
#include "pg_probackup_state.h"
4545

46+
#if defined(WIN32) && !(defined(_UCRT) && defined(__MINGW64__))
47+
#error Windows port requires compilation in MinGW64 UCRT environment
48+
#endif
49+
4650
/* Wrap the code that we're going to delete after refactoring in this define*/
4751
#define REFACTORE_ME
4852

src/utils/logger.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -811,11 +811,7 @@ logfile_getname(const char *format, time_t timestamp)
811811
len = strlen(filename);
812812

813813
/* Treat log_filename as a strftime pattern */
814-
#ifdef WIN32
815-
if (pg_strftime(filename + len, MAXPGPATH - len, format, tm) <= 0)
816-
#else
817814
if (strftime(filename + len, MAXPGPATH - len, format, tm) <= 0)
818-
#endif
819815
elog_stderr(ERROR, "strftime(%s) failed: %s", format, strerror(errno));
820816

821817
return filename;

0 commit comments

Comments
 (0)