Skip to content

Commit 0a510f7

Browse files
committed
Some fixes for windows build
1 parent 1e9615f commit 0a510f7

File tree

6 files changed

+14
-1
lines changed

6 files changed

+14
-1
lines changed

src/backup.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include <unistd.h>
2323

2424
#include "utils/thread.h"
25+
#include <time.h>
2526

2627
#define PG_STOP_BACKUP_TIMEOUT 300
2728

src/parsexlog.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#endif
2323

2424
#include "utils/thread.h"
25+
#include <time.h>
2526

2627
/*
2728
* RmgrNames is an array of resource manager names, to make error messages

src/pg_probackup.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#include <sys/stat.h>
1717

1818
#include "utils/thread.h"
19+
#include <time.h>
1920

2021
const char *PROGRAM_VERSION = "2.0.24";
2122
const char *PROGRAM_URL = "https://github.com/postgrespro/pg_probackup";

src/utils/logger.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include "logger.h"
1515
#include "pgut.h"
1616
#include "thread.h"
17+
#include <time.h>
1718

1819
/* Logger parameters */
1920

src/utils/thread.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,11 @@
99

1010
#include "thread.h"
1111

12+
#ifdef WIN32
13+
DWORD main_tid = 0;
14+
#else
1215
pthread_t main_tid = 0;
13-
16+
#endif
1417
#ifdef WIN32
1518
#include <errno.h>
1619

src/utils/thread.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,13 @@ extern int pthread_join(pthread_t th, void **thread_return);
2828
#include <pthread.h>
2929
#endif
3030

31+
#ifdef WIN32
32+
extern DWORD main_tid;
33+
#else
3134
extern pthread_t main_tid;
35+
#endif
36+
37+
3238

3339
extern int pthread_lock(pthread_mutex_t *mp);
3440

0 commit comments

Comments
 (0)