Re: psql patch - Mailing list pgsql-patches

From Peter Eisentraut
Subject Re: psql patch
Date
Msg-id Pine.LNX.4.44.0303211121230.2387-100000@peter.localdomain
Whole thread Raw
In response to psql patch  ("Jeroen T. Vermeulen" <jtv@xs4all.nl>)
Responses Re: psql patch  (Bruce Momjian <pgman@candle.pha.pa.us>)
List pgsql-patches
Configure already has provisions for the single-argument gettimeofday
form.  Please use that and remove the code below.


Jeroen T. Vermeulen writes:

+
+ /* Workarounds for Windows */
+ /* Probably to be moved up the source tree in the future, perhaps to be
replaced by
+  * more specific checks like configure-style HAVE_GETTIMEOFDAY macros.
+  */
+ #ifndef WIN32
+
+ typedef struct timeval TimevalStruct;
+ #define GETTIMEOFDAY(T) gettimeofday(T, NULL)
+ #define DIFF_MSEC(T, U) ((((T)->tv_sec - (U)->tv_sec) * 1000000.0 +
(T)->tv_usec -
(U)->tv_usec) / 1000.0)
+
+ #else
+
+ typedef struct _timeb TimevalStruct;
+ #define GETTIMEOFDAY(T) _ftime(&T)
+ #define DIFF_MSEC(T, U) ((((T)->time - (U)->time) * 1000.0 +
(T)->millitm -
(U)->millitm))
+
+ #endif
+
+

--
Peter Eisentraut   peter_e@gmx.net



pgsql-patches by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: Add CLUSTER ON to pg_dumps
Next
From: Peter Eisentraut
Date:
Subject: Re: Forgotten?