Skip to content

Commit 6bd3433

Browse files
committed
Oops, can't do cpp tests inside macros; make two macros instead.
1 parent 2afa36b commit 6bd3433

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/include/miscadmin.h

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
1313
* Portions Copyright (c) 1994, Regents of the University of California
1414
*
15-
* $PostgreSQL: pgsql/src/include/miscadmin.h,v 1.143 2004/01/09 21:08:50 momjian Exp $
15+
* $PostgreSQL: pgsql/src/include/miscadmin.h,v 1.144 2004/01/09 23:29:31 momjian Exp $
1616
*
1717
* NOTES
1818
* some of the information in this file should be moved to
@@ -96,19 +96,22 @@ do { \
9696
CritSectionCount--; \
9797
} while(0)
9898

99+
#ifndef WIN32
99100
#define PG_USLEEP(_usec) \
100101
do { \
101-
#ifndef WIN32
102102
/* This will overflow on systems with 32-bit ints for > ~2000 secs */ \
103103
struct timeval delay; \
104104
\
105105
delay.tv_sec = (_usec) / 1000000; \
106106
delay.tv_usec = ((_usec) % 1000000); \
107107
(void) select(0, NULL, NULL, NULL, &delay); \
108+
} while(0)
108109
#else
109-
Sleep(_usec < 500) ? 1 : (_usec+500)/ 1000);
110-
#endif
110+
#define PG_USLEEP(_usec) \
111+
do { \
112+
Sleep(_usec < 500) ? 1 : (_usec+500)/ 1000); \
111113
} while(0)
114+
#endif
112115

113116
/*****************************************************************************
114117
* globals.h -- *

0 commit comments

Comments
 (0)