From 93120f3501cc9603bfbaf87dea815feb77b782b3 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Sun, 16 Jul 2006 20:17:04 +0000 Subject: 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. --- src/port/pgsleep.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'src/port/pgsleep.c') 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 $ * *------------------------------------------------------------------------- */ @@ -15,6 +15,12 @@ #include #include +/* + * 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. * @@ -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) */ -- cgit v1.2.3