Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
c42581eb
Commit
c42581eb
authored
May 16, 2003
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow interfaces to compile under MingGW/Win32 by adding _P to symbols
in ecpg.
parent
32be7207
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
111 additions
and
70 deletions
+111
-70
src/include/port.h
src/include/port.h
+2
-1
src/include/port/win32.h
src/include/port/win32.h
+1
-13
src/interfaces/ecpg/preproc/c_keywords.c
src/interfaces/ecpg/preproc/c_keywords.c
+2
-2
src/interfaces/ecpg/preproc/keywords.c
src/interfaces/ecpg/preproc/keywords.c
+9
-9
src/interfaces/ecpg/preproc/preproc.y
src/interfaces/ecpg/preproc/preproc.y
+44
-45
src/port/gettimeofday.c
src/port/gettimeofday.c
+53
-0
No files found.
src/include/port.h
View file @
c42581eb
...
@@ -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
...
...
src/include/port/win32.h
View file @
c42581eb
/* $Header: /cvsroot/pgsql/src/include/port/win32.h,v 1.1
0 2003/05/15 16:35:29
momjian Exp $ */
/* $Header: /cvsroot/pgsql/src/include/port/win32.h,v 1.1
1 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
src/interfaces/ecpg/preproc/c_keywords.c
View file @
c42581eb
...
@@ -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
},
...
...
src/interfaces/ecpg/preproc/keywords.c
View file @
c42581eb
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/keywords.c,v 1.5
6 2003/02/14 13:17:13 meskes
Exp $
* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/keywords.c,v 1.5
7 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
},
...
...
src/interfaces/ecpg/preproc/preproc.y
View file @
c42581eb
/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/Attic/preproc.y,v 1.21
7 2003/05/14 14:37:35 meskes
Exp $ */
/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/Attic/preproc.y,v 1.21
8 2003/05/16 04:59:22 momjian
Exp $ */
/* Copyright comment */
/* Copyright comment */
%{
%{
...
@@ -177,12 +177,12 @@ make_name(void)
...
@@ -177,12 +177,12 @@ make_name(void)
%token TYPECAST
%token TYPECAST
/* ordinary key words in alphabetical order */
/* ordinary key words in alphabetical order */
%token <keyword> ABORT_P ABSOLUTE ACCESS ACTION ADD AFTER
%token <keyword> ABORT_P ABSOLUTE
_P
ACCESS ACTION ADD AFTER
AGGREGATE ALL ALTER ANALYSE ANALYZE AND ANY AS ASC
AGGREGATE ALL ALTER ANALYSE ANALYZE AND ANY AS ASC
ASSERTION ASSIGNMENT AT AUTHORIZATION
ASSERTION ASSIGNMENT AT AUTHORIZATION
BACKWARD BEFORE BEGIN_P BETWEEN BIGINT BINARY BIT
BACKWARD BEFORE BEGIN_P BETWEEN BIGINT BINARY BIT
BOOLEAN BOTH BY
BOOLEAN
_P
BOTH BY
CACHE CALLED CASCADE CASE CAST CHAIN CHAR_P
CACHE CALLED CASCADE CASE CAST CHAIN CHAR_P
CHARACTER CHARACTERISTICS CHECK CHECKPOINT CLASS CLOSE
CHARACTER CHARACTERISTICS CHECK CHECKPOINT CLASS CLOSE
...
@@ -191,9 +191,9 @@ make_name(void)
...
@@ -191,9 +191,9 @@ make_name(void)
CREATE CREATEDB CREATEUSER CROSS CURRENT_DATE CURRENT_TIME
CREATE CREATEDB CREATEUSER CROSS CURRENT_DATE CURRENT_TIME
CURRENT_TIMESTAMP CURRENT_USER CURSOR CYCLE
CURRENT_TIMESTAMP CURRENT_USER CURSOR CYCLE
DATABASE DAY_P DEALLOCATE DEC DECIMAL DECLARE DEFAULT
DATABASE DAY_P DEALLOCATE DEC DECIMAL
_P
DECLARE DEFAULT
DEFERRABLE DEFERRED DEFINER DELETE_P DELIMITER DELIMITERS
DEFERRABLE DEFERRED DEFINER DELETE_P DELIMITER DELIMITERS
DESC DISTINCT DO DOMAIN_P DOUBLE DROP
DESC DISTINCT DO DOMAIN_P DOUBLE
_P
DROP
EACH ELSE ENCODING ENCRYPTED END_P ESCAPE EXCEPT EXCLUSIVE
EACH ELSE ENCODING ENCRYPTED END_P ESCAPE EXCEPT EXCLUSIVE
EXECUTE EXISTS EXPLAIN EXTERNAL EXTRACT
EXECUTE EXISTS EXPLAIN EXTERNAL EXTRACT
...
@@ -204,7 +204,7 @@ make_name(void)
...
@@ -204,7 +204,7 @@ make_name(void)
HANDLER HAVING HOUR_P
HANDLER HAVING HOUR_P
ILIKE IMMEDIATE IMMUTABLE IMPLICIT_P IN_P INCREMENT INDEX INHERITS
ILIKE IMMEDIATE IMMUTABLE IMPLICIT_P IN_P INCREMENT INDEX INHERITS
INITIALLY INNER_P INOUT INPUT
INSENSITIVE INSERT INSTEAD INT
INITIALLY INNER_P INOUT INPUT
_P INSENSITIVE INSERT INSTEAD INT_P
INTEGER INTERSECT INTERVAL INTO INVOKER IS ISNULL ISOLATION
INTEGER INTERSECT INTERVAL INTO INVOKER IS ISNULL ISOLATION
JOIN
JOIN
...
@@ -226,12 +226,12 @@ make_name(void)
...
@@ -226,12 +226,12 @@ make_name(void)
PARTIAL PASSWORD PATH_P PENDANT PLACING POSITION
PARTIAL PASSWORD PATH_P PENDANT PLACING POSITION
PRECISION PRESERVE PREPARE PRIMARY PRIOR PRIVILEGES PROCEDURAL PROCEDURE
PRECISION PRESERVE PREPARE PRIMARY PRIOR PRIVILEGES PROCEDURAL PROCEDURE
READ REAL RECHECK REFERENCES REINDEX RELATIVE RENAME REPLACE
READ REAL RECHECK REFERENCES REINDEX RELATIVE
_P
RENAME REPLACE
RESET RESTRICT RETURNS REVOKE RIGHT ROLLBACK ROW ROWS RULE
RESET RESTRICT RETURNS REVOKE RIGHT ROLLBACK ROW ROWS RULE
SCHEMA SCROLL SECOND_P SECURITY SELECT SEQUENCE SERIALIZABLE
SCHEMA SCROLL SECOND_P SECURITY SELECT SEQUENCE SERIALIZABLE
SESSION SESSION_USER SET SETOF SHARE SHOW SIMILAR SIMPLE SMALLINT SOME
SESSION SESSION_USER SET SETOF SHARE SHOW SIMILAR SIMPLE SMALLINT SOME
STABLE START STATEMENT STATISTICS STDIN STDOUT STORAGE STRICT
STABLE START STATEMENT STATISTICS STDIN STDOUT STORAGE STRICT
_P
SUBSTRING SYSID
SUBSTRING SYSID
TABLE TEMP TEMPLATE TEMPORARY THEN TIME TIMESTAMP TO TOAST
TABLE TEMP TEMPLATE TEMPORARY THEN TIME TIMESTAMP TO TOAST
...
@@ -1688,8 +1688,8 @@ FetchStmt: FETCH direction fetch_how_many from_in name ecpg_into
...
@@ -1688,8 +1688,8 @@ FetchStmt: FETCH direction fetch_how_many from_in name ecpg_into
direction: FORWARD { $$ = make_str("forward"); }
direction: FORWARD { $$ = make_str("forward"); }
| BACKWARD { $$ = make_str("backward"); }
| BACKWARD { $$ = make_str("backward"); }
| RELATIVE { $$ = make_str("relative"); }
| RELATIVE
_P
{ $$ = make_str("relative"); }
| ABSOLUTE
| ABSOLUTE
_P
{
{
mmerror(PARSE_ERROR, ET_WARNING, "Currently unsupported FETCH/ABSOLUTE will be passed to backend, backend will use RELATIVE");
mmerror(PARSE_ERROR, ET_WARNING, "Currently unsupported FETCH/ABSOLUTE will be passed to backend, backend will use RELATIVE");
$$ = make_str("absolute");
$$ = make_str("absolute");
...
@@ -1973,11 +1973,11 @@ createfunc_opt_item: AS func_as
...
@@ -1973,11 +1973,11 @@ createfunc_opt_item: AS func_as
{ $$ = make_str("stable"); }
{ $$ = make_str("stable"); }
| VOLATILE
| VOLATILE
{ $$ = make_str("volatile"); }
{ $$ = make_str("volatile"); }
| CALLED ON NULL_P INPUT
| CALLED ON NULL_P INPUT
_P
{ $$ = make_str("called on null input"); }
{ $$ = make_str("called on null input"); }
| RETURNS NULL_P ON NULL_P INPUT
| RETURNS NULL_P ON NULL_P INPUT
_P
{ $$ = make_str("returns null on null input"); }
{ $$ = make_str("returns null on null input"); }
| STRICT
| STRICT
_P
{ $$ = make_str("strict"); }
{ $$ = make_str("strict"); }
| EXTERNAL SECURITY DEFINER
| EXTERNAL SECURITY DEFINER
{ $$ = make_str("external security definer"); }
{ $$ = make_str("external security definer"); }
...
@@ -3010,7 +3010,7 @@ GenericType: type_name { $$ = $1; }
...
@@ -3010,7 +3010,7 @@ GenericType: type_name { $$ = $1; }
* Provide real DECIMAL() and NUMERIC() implementations now - Jan 1998-12-30
* Provide real DECIMAL() and NUMERIC() implementations now - Jan 1998-12-30
* - thomas 1997-09-18
* - thomas 1997-09-18
*/
*/
Numeric: INT
Numeric: INT
_P
{ $$ = make_str("int"); }
{ $$ = make_str("int"); }
| INTEGER
| INTEGER
{ $$ = make_str("integer"); }
{ $$ = make_str("integer"); }
...
@@ -3022,15 +3022,15 @@ Numeric: INT
...
@@ -3022,15 +3022,15 @@ Numeric: INT
{ $$ = make_str("real"); }
{ $$ = make_str("real"); }
| FLOAT_P opt_float
| FLOAT_P opt_float
{ $$ = cat2_str(make_str("float"), $2); }
{ $$ = cat2_str(make_str("float"), $2); }
| DOUBLE PRECISION
| DOUBLE
_P
PRECISION
{ $$ = make_str("double precision"); }
{ $$ = make_str("double precision"); }
| DECIMAL opt_decimal
| DECIMAL
_P
opt_decimal
{ $$ = cat2_str(make_str("decimal"), $2); }
{ $$ = cat2_str(make_str("decimal"), $2); }
| DEC opt_decimal
| DEC opt_decimal
{ $$ = cat2_str(make_str("dec"), $2); }
{ $$ = cat2_str(make_str("dec"), $2); }
| NUMERIC opt_numeric
| NUMERIC opt_numeric
{ $$ = cat2_str(make_str("numeric"), $2); }
{ $$ = cat2_str(make_str("numeric"), $2); }
| BOOLEAN
| BOOLEAN
_P
{ $$ = make_str("boolean"); }
{ $$ = make_str("boolean"); }
;
;
...
@@ -4607,11 +4607,11 @@ simple_type: unsigned_type { $$=$1; }
...
@@ -4607,11 +4607,11 @@ simple_type: unsigned_type { $$=$1; }
;
;
unsigned_type: SQL_UNSIGNED SQL_SHORT { $$ = ECPGt_unsigned_short; }
unsigned_type: SQL_UNSIGNED SQL_SHORT { $$ = ECPGt_unsigned_short; }
| SQL_UNSIGNED SQL_SHORT INT { $$ = ECPGt_unsigned_short; }
| SQL_UNSIGNED SQL_SHORT INT
_P
{ $$ = ECPGt_unsigned_short; }
| SQL_UNSIGNED { $$ = ECPGt_unsigned_int; }
| SQL_UNSIGNED { $$ = ECPGt_unsigned_int; }
| SQL_UNSIGNED INT { $$ = ECPGt_unsigned_int; }
| SQL_UNSIGNED INT
_P
{ $$ = ECPGt_unsigned_int; }
| SQL_UNSIGNED SQL_LONG { $$ = ECPGt_unsigned_long; }
| SQL_UNSIGNED SQL_LONG { $$ = ECPGt_unsigned_long; }
| SQL_UNSIGNED SQL_LONG INT { $$ = ECPGt_unsigned_long; }
| SQL_UNSIGNED SQL_LONG INT
_P
{ $$ = ECPGt_unsigned_long; }
| SQL_UNSIGNED SQL_LONG SQL_LONG
| SQL_UNSIGNED SQL_LONG SQL_LONG
{
{
#ifdef HAVE_LONG_LONG_INT_64
#ifdef HAVE_LONG_LONG_INT_64
...
@@ -4620,7 +4620,7 @@ unsigned_type: SQL_UNSIGNED SQL_SHORT { $$ = ECPGt_unsigned_short; }
...
@@ -4620,7 +4620,7 @@ unsigned_type: SQL_UNSIGNED SQL_SHORT { $$ = ECPGt_unsigned_short; }
$$ = ECPGt_unsigned_long;
$$ = ECPGt_unsigned_long;
#endif
#endif
}
}
| SQL_UNSIGNED SQL_LONG SQL_LONG INT
| SQL_UNSIGNED SQL_LONG SQL_LONG INT
_P
{
{
#ifdef HAVE_LONG_LONG_INT_64
#ifdef HAVE_LONG_LONG_INT_64
$$ = ECPGt_unsigned_long_long;
$$ = ECPGt_unsigned_long_long;
...
@@ -4632,10 +4632,10 @@ unsigned_type: SQL_UNSIGNED SQL_SHORT { $$ = ECPGt_unsigned_short; }
...
@@ -4632,10 +4632,10 @@ unsigned_type: SQL_UNSIGNED SQL_SHORT { $$ = ECPGt_unsigned_short; }
;
;
signed_type: SQL_SHORT { $$ = ECPGt_short; }
signed_type: SQL_SHORT { $$ = ECPGt_short; }
| SQL_SHORT INT { $$ = ECPGt_short; }
| SQL_SHORT INT
_P
{ $$ = ECPGt_short; }
| INT { $$ = ECPGt_int; }
| INT
_P
{ $$ = ECPGt_int; }
| SQL_LONG { $$ = ECPGt_long; }
| SQL_LONG { $$ = ECPGt_long; }
| SQL_LONG INT { $$ = ECPGt_long; }
| SQL_LONG INT
_P
{ $$ = ECPGt_long; }
| SQL_LONG SQL_LONG
| SQL_LONG SQL_LONG
{
{
#ifdef HAVE_LONG_LONG_INT_64
#ifdef HAVE_LONG_LONG_INT_64
...
@@ -4644,7 +4644,7 @@ signed_type: SQL_SHORT { $$ = ECPGt_short; }
...
@@ -4644,7 +4644,7 @@ signed_type: SQL_SHORT { $$ = ECPGt_short; }
$$ = ECPGt_long;
$$ = ECPGt_long;
#endif
#endif
}
}
| SQL_LONG SQL_LONG INT
| SQL_LONG SQL_LONG INT
_P
{
{
#ifdef HAVE_LONG_LONG_INT_64
#ifdef HAVE_LONG_LONG_INT_64
$$ = ECPGt_long_long;
$$ = ECPGt_long_long;
...
@@ -5318,7 +5318,7 @@ function_name: ident { $$ = $1; }
...
@@ -5318,7 +5318,7 @@ function_name: ident { $$ = $1; }
ColLabel: ECPGColLabel { $$ = $1; }
ColLabel: ECPGColLabel { $$ = $1; }
| ECPGTypeName { $$ = $1; }
| ECPGTypeName { $$ = $1; }
| CHAR_P { $$ = make_str("char"); }
| CHAR_P { $$ = make_str("char"); }
| INT { $$ = make_str("int"); }
| INT
_P
{ $$ = make_str("int"); }
| UNION { $$ = make_str("union"); }
| UNION { $$ = make_str("union"); }
;
;
...
@@ -5347,7 +5347,7 @@ ECPGColLabel: ECPGColLabelCommon { $$ = $1; }
...
@@ -5347,7 +5347,7 @@ ECPGColLabel: ECPGColLabelCommon { $$ = $1; }
*/
*/
unreserved_keyword:
unreserved_keyword:
ABORT_P { $$ = make_str("abort"); }
ABORT_P { $$ = make_str("abort"); }
| ABSOLUTE
{ $$ = make_str("absolute"); }
| ABSOLUTE
_P
{ $$ = make_str("absolute"); }
| ACCESS { $$ = make_str("access"); }
| ACCESS { $$ = make_str("access"); }
| ACTION { $$ = make_str("action"); }
| ACTION { $$ = make_str("action"); }
| ADD { $$ = make_str("add"); }
| ADD { $$ = make_str("add"); }
...
@@ -5388,7 +5388,7 @@ unreserved_keyword:
...
@@ -5388,7 +5388,7 @@ unreserved_keyword:
| DELIMITER { $$ = make_str("delimiter"); }
| DELIMITER { $$ = make_str("delimiter"); }
| DELIMITERS { $$ = make_str("delimiters"); }
| DELIMITERS { $$ = make_str("delimiters"); }
| DOMAIN_P { $$ = make_str("domain"); }
| DOMAIN_P { $$ = make_str("domain"); }
| DOUBLE { $$ = make_str("double"); }
| DOUBLE
_P
{ $$ = make_str("double"); }
| DROP { $$ = make_str("drop"); }
| DROP { $$ = make_str("drop"); }
| EACH { $$ = make_str("each"); }
| EACH { $$ = make_str("each"); }
| ENCODING { $$ = make_str("encoding"); }
| ENCODING { $$ = make_str("encoding"); }
...
@@ -5459,7 +5459,7 @@ unreserved_keyword:
...
@@ -5459,7 +5459,7 @@ unreserved_keyword:
| READ { $$ = make_str("read"); }
| READ { $$ = make_str("read"); }
| RECHECK { $$ = make_str("recheck"); }
| RECHECK { $$ = make_str("recheck"); }
| REINDEX { $$ = make_str("reindex"); }
| REINDEX { $$ = make_str("reindex"); }
| RELATIVE
{ $$ = make_str("relative"); }
| RELATIVE
_P
{ $$ = make_str("relative"); }
| RENAME { $$ = make_str("rename"); }
| RENAME { $$ = make_str("rename"); }
| REPLACE { $$ = make_str("replace"); }
| REPLACE { $$ = make_str("replace"); }
| RESET { $$ = make_str("reset"); }
| RESET { $$ = make_str("reset"); }
...
@@ -5536,12 +5536,12 @@ col_name_keyword:
...
@@ -5536,12 +5536,12 @@ col_name_keyword:
| COALESCE { $$ = make_str("coalesce"); }
| COALESCE { $$ = make_str("coalesce"); }
| CONVERT { $$ = make_str("convert"); }
| CONVERT { $$ = make_str("convert"); }
| DEC { $$ = make_str("dec"); }
| DEC { $$ = make_str("dec"); }
| DECIMAL { $$ = make_str("decimal"); }
| DECIMAL
_P
{ $$ = make_str("decimal"); }
| EXISTS { $$ = make_str("exists"); }
| EXISTS { $$ = make_str("exists"); }
| EXTRACT { $$ = make_str("extract"); }
| EXTRACT { $$ = make_str("extract"); }
| FLOAT_P { $$ = make_str("float"); }
| FLOAT_P { $$ = make_str("float"); }
/* INT must be excluded from ECPGColLabel because of conflict
/* INT must be excluded from ECPGColLabel because of conflict
| INT { $$ = make_str("int"); }
| INT
_P
{ $$ = make_str("int"); }
*/
*/
| INTEGER { $$ = make_str("integer"); }
| INTEGER { $$ = make_str("integer"); }
| INTERVAL { $$ = make_str("interval"); }
| INTERVAL { $$ = make_str("interval"); }
...
@@ -5787,14 +5787,13 @@ c_anything: IDENT { $$ = $1; }
...
@@ -5787,14 +5787,13 @@ c_anything: IDENT { $$ = $1; }
| S_TYPEDEF { $$ = make_str("typedef"); }
| S_TYPEDEF { $$ = make_str("typedef"); }
| SQL_BOOL { $$ = make_str("bool"); }
| SQL_BOOL { $$ = make_str("bool"); }
| SQL_ENUM { $$ = make_str("enum"); }
| SQL_ENUM { $$ = make_str("enum"); }
| INT { $$ = make_str("int"); }
| INT
_P
{ $$ = make_str("int"); }
| SQL_LONG { $$ = make_str("long"); }
| SQL_LONG { $$ = make_str("long"); }
| SQL_SHORT { $$ = make_str("short"); }
| SQL_SHORT { $$ = make_str("short"); }
| SQL_SIGNED { $$ = make_str("signed"); }
| SQL_SIGNED { $$ = make_str("signed"); }
| SQL_STRUCT { $$ = make_str("struct"); }
| SQL_STRUCT { $$ = make_str("struct"); }
| SQL_UNSIGNED { $$ = make_str("unsigned"); }
| SQL_UNSIGNED { $$ = make_str("unsigned"); }
| CHAR_P { $$ = make_str("char"); }
| CHAR_P { $$ = make_str("char"); }
| DOUBLE { $$ = make_str("double"); }
| FLOAT_P { $$ = make_str("float"); }
| FLOAT_P { $$ = make_str("float"); }
| UNION { $$ = make_str("union"); }
| UNION { $$ = make_str("union"); }
| VARCHAR { $$ = make_str("varchar"); }
| VARCHAR { $$ = make_str("varchar"); }
...
...
src/port/gettimeofday.c
0 → 100644
View file @
c42581eb
/*
* $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
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment