aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>2004-01-09 23:29:31 +0000
committerBruce Momjian <bruce@momjian.us>2004-01-09 23:29:31 +0000
commit6bd343329e62fe9da7917f4a22ffc57ec7060e45 (patch)
treecea2099b486224c1ac42e1dee14516a55b670478 /src
parent2afa36be9d5c6ca00ce75ba8d919236108f9825c (diff)
downloadpostgresql-6bd343329e62fe9da7917f4a22ffc57ec7060e45.tar.gz
postgresql-6bd343329e62fe9da7917f4a22ffc57ec7060e45.zip
Oops, can't do cpp tests inside macros; make two macros instead.
Diffstat (limited to 'src')
-rw-r--r--src/include/miscadmin.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/include/miscadmin.h b/src/include/miscadmin.h
index 9b7bb20112d..22b42042ad7 100644
--- a/src/include/miscadmin.h
+++ b/src/include/miscadmin.h
@@ -12,7 +12,7 @@
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/miscadmin.h,v 1.143 2004/01/09 21:08:50 momjian Exp $
+ * $PostgreSQL: pgsql/src/include/miscadmin.h,v 1.144 2004/01/09 23:29:31 momjian Exp $
*
* NOTES
* some of the information in this file should be moved to
@@ -96,19 +96,22 @@ do { \
CritSectionCount--; \
} while(0)
+#ifndef WIN32
#define PG_USLEEP(_usec) \
do { \
-#ifndef WIN32
/* This will overflow on systems with 32-bit ints for > ~2000 secs */ \
struct timeval delay; \
\
delay.tv_sec = (_usec) / 1000000; \
delay.tv_usec = ((_usec) % 1000000); \
(void) select(0, NULL, NULL, NULL, &delay); \
+} while(0)
#else
- Sleep(_usec < 500) ? 1 : (_usec+500)/ 1000);
-#endif
+#define PG_USLEEP(_usec) \
+do { \
+ Sleep(_usec < 500) ? 1 : (_usec+500)/ 1000); \
} while(0)
+#endif
/*****************************************************************************
* globals.h -- *