Commit c42581eb authored by Bruce Momjian's avatar Bruce Momjian

Allow interfaces to compile under MingGW/Win32 by adding _P to symbols

in ecpg.
parent 32be7207
......@@ -6,7 +6,7 @@
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $Id: port.h,v 1.2 2003/05/16 01:57:51 momjian Exp $
* $Id: port.h,v 1.3 2003/05/16 04:59:22 momjian Exp $
*
*-------------------------------------------------------------------------
*/
......@@ -34,6 +34,7 @@ int pgunlink(const char *path);
#endif
extern int copydir(char *fromdir,char *todir);
/* Last parameter not used */
extern int gettimeofday(struct timeval *tp, struct timezone *tzp);
#else
......
/* $Header: /cvsroot/pgsql/src/include/port/win32.h,v 1.10 2003/05/15 16:35:29 momjian Exp $ */
/* $Header: /cvsroot/pgsql/src/include/port/win32.h,v 1.11 2003/05/16 04:59:22 momjian Exp $ */
/* undefine and redefine after #include */
#undef mkdir
......@@ -164,15 +164,3 @@ struct timezone
#define ECONNRESET WSAECONNRESET
#define EINPROGRESS WSAEINPROGRESS
/*
* Supplement to <math.h>.
*/
#define isnan _isnan
#define finite _finite
extern double rint(double x);
/*
* Supplement to <stdio.h>.
*/
#define snprintf _snprintf
#define vsnprintf _vsnprintf
......@@ -25,11 +25,11 @@ static ScanKeyword ScanKeywords[] = {
{"bool", SQL_BOOL},
{"char", CHAR_P},
{"const", S_CONST},
{"double", DOUBLE},
{"double", DOUBLE_P},
{"enum", SQL_ENUM},
{"extern", S_EXTERN},
{"float", FLOAT_P},
{"int", INT},
{"int", INT_P},
{"long", SQL_LONG},
{"register", S_REGISTER},
{"short", SQL_SHORT},
......
......@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/keywords.c,v 1.56 2003/02/14 13:17:13 meskes Exp $
* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/keywords.c,v 1.57 2003/05/16 04:59:22 momjian Exp $
*
*-------------------------------------------------------------------------
*/
......@@ -29,7 +29,7 @@
static ScanKeyword ScanKeywords[] = {
/* name, value */
{"abort", ABORT_P},
{"absolute", ABSOLUTE},
{"absolute", ABSOLUTE_P},
{"access", ACCESS},
{"action", ACTION},
{"add", ADD},
......@@ -54,7 +54,7 @@ static ScanKeyword ScanKeywords[] = {
{"bigint", BIGINT},
{"binary", BINARY},
{"bit", BIT},
{"boolean", BOOLEAN},
{"boolean", BOOLEAN_P},
{"both", BOTH},
{"by", BY},
{"cache", CACHE},
......@@ -96,7 +96,7 @@ static ScanKeyword ScanKeywords[] = {
{"day", DAY_P},
{"deallocate", DEALLOCATE},
{"dec", DEC},
{"decimal", DECIMAL},
{"decimal", DECIMAL_P},
{"declare", DECLARE},
{"default", DEFAULT},
{"deferrable", DEFERRABLE},
......@@ -109,7 +109,7 @@ static ScanKeyword ScanKeywords[] = {
{"distinct", DISTINCT},
{"do", DO},
{"domain", DOMAIN_P},
{"double", DOUBLE},
{"double", DOUBLE_P},
{"drop", DROP},
{"each", EACH},
{"else", ELSE},
......@@ -153,11 +153,11 @@ static ScanKeyword ScanKeywords[] = {
{"initially", INITIALLY},
{"inner", INNER_P},
{"inout", INOUT},
{"input", INPUT},
{"input", INPUT_P},
{"insensitive", INSENSITIVE},
{"insert", INSERT},
{"instead", INSTEAD},
{"int", INT},
{"int", INT_P},
{"integer", INTEGER},
{"intersect", INTERSECT},
{"interval", INTERVAL},
......@@ -237,7 +237,7 @@ static ScanKeyword ScanKeywords[] = {
{"recheck", RECHECK},
{"references", REFERENCES},
{"reindex", REINDEX},
{"relative", RELATIVE},
{"relative", RELATIVE_P},
{"rename", RENAME},
{"replace", REPLACE},
{"reset", RESET},
......@@ -273,7 +273,7 @@ static ScanKeyword ScanKeywords[] = {
{"stdin", STDIN},
{"stdout", STDOUT},
{"storage", STORAGE},
{"strict", STRICT},
{"strict", STRICT_P},
{"substring", SUBSTRING},
{"sysid", SYSID},
{"table", TABLE},
......
This diff is collapsed.
/*
* $Header: /cvsroot/pgsql/src/port/gettimeofday.c,v 1.1 2003/05/16 04:59:24 momjian Exp $
*
* Copyright (c) 2003 SRA, Inc.
* Copyright (c) 2003 SKC, Inc.
*
* Permission to use, copy, modify, and distribute this software and
* its documentation for any purpose, without fee, and without a
* written agreement is hereby granted, provided that the above
* copyright notice and this paragraph and the following two
* paragraphs appear in all copies.
*
* IN NO EVENT SHALL THE AUTHOR BE LIABLE TO ANY PARTY FOR DIRECT,
* INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING
* LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS
* DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
*
* THE AUTHOR SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS
* IS" BASIS, AND THE AUTHOR HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE,
* SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
*/
#include "postgres.h"
#include "sys/time.h"
/* FILETIME of Jan 1 1970 00:00:00. */
static const unsigned __int64 epoch = 116444736000000000L;
/*
* timezone information is stored outside the kernel so tzp isn't used anymore.
*/
int
gettimeofday(struct timeval *tp, struct timezone *tzp)
{
FILETIME file_time;
SYSTEMTIME system_time;
ULARGE_INTEGER ularge;
GetSystemTime(&system_time);
SystemTimeToFileTime(&system_time, &file_time);
ularge.LowPart = file_time.dwLowDateTime;
ularge.HighPart = file_time.dwHighDateTime;
tp->tv_sec = (long)((ularge.QuadPart - epoch) / 10000000L);
tp->tv_usec = (long)(system_time.wMilliseconds * 1000);
return 0;
}
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