Commit 6bd34332 authored by Bruce Momjian's avatar Bruce Momjian

Oops, can't do cpp tests inside macros; make two macros instead.

parent 2afa36be
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California * 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 * NOTES
* some of the information in this file should be moved to * some of the information in this file should be moved to
...@@ -96,19 +96,22 @@ do { \ ...@@ -96,19 +96,22 @@ do { \
CritSectionCount--; \ CritSectionCount--; \
} while(0) } while(0)
#ifndef WIN32
#define PG_USLEEP(_usec) \ #define PG_USLEEP(_usec) \
do { \ do { \
#ifndef WIN32
/* This will overflow on systems with 32-bit ints for > ~2000 secs */ \ /* This will overflow on systems with 32-bit ints for > ~2000 secs */ \
struct timeval delay; \ struct timeval delay; \
\ \
delay.tv_sec = (_usec) / 1000000; \ delay.tv_sec = (_usec) / 1000000; \
delay.tv_usec = ((_usec) % 1000000); \ delay.tv_usec = ((_usec) % 1000000); \
(void) select(0, NULL, NULL, NULL, &delay); \ (void) select(0, NULL, NULL, NULL, &delay); \
} while(0)
#else #else
Sleep(_usec < 500) ? 1 : (_usec+500)/ 1000); #define PG_USLEEP(_usec) \
#endif do { \
Sleep(_usec < 500) ? 1 : (_usec+500)/ 1000); \
} while(0) } while(0)
#endif
/***************************************************************************** /*****************************************************************************
* globals.h -- * * globals.h -- *
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment