diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2006-07-16 20:17:04 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2006-07-16 20:17:04 +0000 |
commit | 93120f3501cc9603bfbaf87dea815feb77b782b3 (patch) | |
tree | cb6e2e8c4cfa6ae7ba5ff0b920f79408cd527f3c /src/port/pgsleep.c | |
parent | e96373aae58f0e12a4c1845d5c10d94729a01b52 (diff) |
In a Windows backend, don't build src/port/pgsleep.c's version of
pg_usleep at all. Instead call the replacement function in
port/win32/signal.c by that name. Avoids tricky macro-redefinition
logic and suppresses a compiler warning; furthermore it ensures that
no one can accidentally use the non-signal-aware version of pg_usleep
in a Windows backend.
Diffstat (limited to 'src/port/pgsleep.c')
-rw-r--r-- | src/port/pgsleep.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/port/pgsleep.c b/src/port/pgsleep.c index d39292880d2..b003d3494db 100644 --- a/src/port/pgsleep.c +++ b/src/port/pgsleep.c @@ -6,7 +6,7 @@ * * Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group * - * $PostgreSQL: pgsql/src/port/pgsleep.c,v 1.7 2006/03/05 15:59:10 momjian Exp $ + * $PostgreSQL: pgsql/src/port/pgsleep.c,v 1.8 2006/07/16 20:17:04 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -16,6 +16,12 @@ #include <sys/time.h> /* + * In a Windows backend, we don't use this implementation, but rather + * the signal-aware version in src/backend/port/win32/signal.c. + */ +#if defined(FRONTEND) || !defined(WIN32) + +/* * pg_usleep --- delay the specified number of microseconds. * * NOTE: although the delay is specified in microseconds, the effective @@ -24,9 +30,6 @@ * * On machines where "long" is 32 bits, the maximum delay is ~2000 seconds. */ -#ifdef pg_usleep -#undef pg_usleep -#endif void pg_usleep(long microsec) { @@ -43,3 +46,5 @@ pg_usleep(long microsec) #endif } } + +#endif /* defined(FRONTEND) || !defined(WIN32) */ |