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 @@ ...@@ -6,7 +6,7 @@
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California * 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); ...@@ -34,6 +34,7 @@ int pgunlink(const char *path);
#endif #endif
extern int copydir(char *fromdir,char *todir); extern int copydir(char *fromdir,char *todir);
/* Last parameter not used */
extern int gettimeofday(struct timeval *tp, struct timezone *tzp); extern int gettimeofday(struct timeval *tp, struct timezone *tzp);
#else #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 */ /* undefine and redefine after #include */
#undef mkdir #undef mkdir
...@@ -164,15 +164,3 @@ struct timezone ...@@ -164,15 +164,3 @@ struct timezone
#define ECONNRESET WSAECONNRESET #define ECONNRESET WSAECONNRESET
#define EINPROGRESS WSAEINPROGRESS #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[] = { ...@@ -25,11 +25,11 @@ static ScanKeyword ScanKeywords[] = {
{"bool", SQL_BOOL}, {"bool", SQL_BOOL},
{"char", CHAR_P}, {"char", CHAR_P},
{"const", S_CONST}, {"const", S_CONST},
{"double", DOUBLE}, {"double", DOUBLE_P},
{"enum", SQL_ENUM}, {"enum", SQL_ENUM},
{"extern", S_EXTERN}, {"extern", S_EXTERN},
{"float", FLOAT_P}, {"float", FLOAT_P},
{"int", INT}, {"int", INT_P},
{"long", SQL_LONG}, {"long", SQL_LONG},
{"register", S_REGISTER}, {"register", S_REGISTER},
{"short", SQL_SHORT}, {"short", SQL_SHORT},
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * 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 @@ ...@@ -29,7 +29,7 @@
static ScanKeyword ScanKeywords[] = { static ScanKeyword ScanKeywords[] = {
/* name, value */ /* name, value */
{"abort", ABORT_P}, {"abort", ABORT_P},
{"absolute", ABSOLUTE}, {"absolute", ABSOLUTE_P},
{"access", ACCESS}, {"access", ACCESS},
{"action", ACTION}, {"action", ACTION},
{"add", ADD}, {"add", ADD},
...@@ -54,7 +54,7 @@ static ScanKeyword ScanKeywords[] = { ...@@ -54,7 +54,7 @@ static ScanKeyword ScanKeywords[] = {
{"bigint", BIGINT}, {"bigint", BIGINT},
{"binary", BINARY}, {"binary", BINARY},
{"bit", BIT}, {"bit", BIT},
{"boolean", BOOLEAN}, {"boolean", BOOLEAN_P},
{"both", BOTH}, {"both", BOTH},
{"by", BY}, {"by", BY},
{"cache", CACHE}, {"cache", CACHE},
...@@ -96,7 +96,7 @@ static ScanKeyword ScanKeywords[] = { ...@@ -96,7 +96,7 @@ static ScanKeyword ScanKeywords[] = {
{"day", DAY_P}, {"day", DAY_P},
{"deallocate", DEALLOCATE}, {"deallocate", DEALLOCATE},
{"dec", DEC}, {"dec", DEC},
{"decimal", DECIMAL}, {"decimal", DECIMAL_P},
{"declare", DECLARE}, {"declare", DECLARE},
{"default", DEFAULT}, {"default", DEFAULT},
{"deferrable", DEFERRABLE}, {"deferrable", DEFERRABLE},
...@@ -109,7 +109,7 @@ static ScanKeyword ScanKeywords[] = { ...@@ -109,7 +109,7 @@ static ScanKeyword ScanKeywords[] = {
{"distinct", DISTINCT}, {"distinct", DISTINCT},
{"do", DO}, {"do", DO},
{"domain", DOMAIN_P}, {"domain", DOMAIN_P},
{"double", DOUBLE}, {"double", DOUBLE_P},
{"drop", DROP}, {"drop", DROP},
{"each", EACH}, {"each", EACH},
{"else", ELSE}, {"else", ELSE},
...@@ -153,11 +153,11 @@ static ScanKeyword ScanKeywords[] = { ...@@ -153,11 +153,11 @@ static ScanKeyword ScanKeywords[] = {
{"initially", INITIALLY}, {"initially", INITIALLY},
{"inner", INNER_P}, {"inner", INNER_P},
{"inout", INOUT}, {"inout", INOUT},
{"input", INPUT}, {"input", INPUT_P},
{"insensitive", INSENSITIVE}, {"insensitive", INSENSITIVE},
{"insert", INSERT}, {"insert", INSERT},
{"instead", INSTEAD}, {"instead", INSTEAD},
{"int", INT}, {"int", INT_P},
{"integer", INTEGER}, {"integer", INTEGER},
{"intersect", INTERSECT}, {"intersect", INTERSECT},
{"interval", INTERVAL}, {"interval", INTERVAL},
...@@ -237,7 +237,7 @@ static ScanKeyword ScanKeywords[] = { ...@@ -237,7 +237,7 @@ static ScanKeyword ScanKeywords[] = {
{"recheck", RECHECK}, {"recheck", RECHECK},
{"references", REFERENCES}, {"references", REFERENCES},
{"reindex", REINDEX}, {"reindex", REINDEX},
{"relative", RELATIVE}, {"relative", RELATIVE_P},
{"rename", RENAME}, {"rename", RENAME},
{"replace", REPLACE}, {"replace", REPLACE},
{"reset", RESET}, {"reset", RESET},
...@@ -273,7 +273,7 @@ static ScanKeyword ScanKeywords[] = { ...@@ -273,7 +273,7 @@ static ScanKeyword ScanKeywords[] = {
{"stdin", STDIN}, {"stdin", STDIN},
{"stdout", STDOUT}, {"stdout", STDOUT},
{"storage", STORAGE}, {"storage", STORAGE},
{"strict", STRICT}, {"strict", STRICT_P},
{"substring", SUBSTRING}, {"substring", SUBSTRING},
{"sysid", SYSID}, {"sysid", SYSID},
{"table", TABLE}, {"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