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
bf06825e
Commit
bf06825e
authored
Sep 14, 2004
by
Tom Lane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Win32 compile fixes for pgbench, pgcrypto, and tsearch.
Claudio Natoli
parent
fc564686
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
34 additions
and
19 deletions
+34
-19
contrib/pgbench/pgbench.c
contrib/pgbench/pgbench.c
+9
-5
contrib/pgcrypto/Makefile
contrib/pgcrypto/Makefile
+6
-1
contrib/tsearch/gistidx.h
contrib/tsearch/gistidx.h
+3
-0
contrib/tsearch/rewrite.c
contrib/tsearch/rewrite.c
+3
-0
contrib/tsearch/txtidx.c
contrib/tsearch/txtidx.c
+13
-13
No files found.
contrib/pgbench/pgbench.c
View file @
bf06825e
/*
* $PostgreSQL: pgsql/contrib/pgbench/pgbench.c,v 1.3
2 2004/08/29 05:06:36 momjian
Exp $
* $PostgreSQL: pgsql/contrib/pgbench/pgbench.c,v 1.3
3 2004/09/14 03:39:23 tgl
Exp $
*
* pgbench: a simple TPC-B like benchmark program for PostgreSQL
* written by Tatsuo Ishii
...
...
@@ -44,6 +44,10 @@
extern
char
*
optarg
;
extern
int
optind
;
#ifdef WIN32
#undef select
#endif
/********************************************************************
* some configurable parameters */
...
...
@@ -705,7 +709,7 @@ main(int argc, char **argv)
int
nsocks
;
/* return from select(2) */
int
maxsock
;
/* max socket number to be waited */
#if
ndef __CYGWIN__
#if
!(defined(__CYGWIN__) || defined(__MINGW32__))
struct
rlimit
rlim
;
#endif
...
...
@@ -755,7 +759,7 @@ main(int argc, char **argv)
fprintf
(
stderr
,
"invalid number of clients: %d
\n
"
,
nclients
);
exit
(
1
);
}
#if
ndef __CYGWIN__
#if
!(defined(__CYGWIN__) || defined(__MINGW32__))
#ifdef RLIMIT_NOFILE
/* most platform uses RLIMIT_NOFILE */
if
(
getrlimit
(
RLIMIT_NOFILE
,
&
rlim
)
==
-
1
)
{
...
...
@@ -772,7 +776,7 @@ main(int argc, char **argv)
fprintf
(
stderr
,
"Use limit/ulimt to increase the limit before using pgbench.
\n
"
);
exit
(
1
);
}
#endif
/* #if
ndef __CYGWIN__
*/
#endif
/* #if
!(defined(__CYGWIN__) || defined(__MINGW32__))
*/
break
;
case
'C'
:
is_connect
=
1
;
...
...
@@ -935,7 +939,7 @@ main(int argc, char **argv)
/* set random seed */
gettimeofday
(
&
tv1
,
0
);
srand
((
uint
)
tv1
.
tv_usec
);
srand
((
u
nsigned
int
)
tv1
.
tv_usec
);
/* get start up time */
gettimeofday
(
&
tv1
,
0
);
...
...
contrib/pgcrypto/Makefile
View file @
bf06825e
#
# $PostgreSQL: pgsql/contrib/pgcrypto/Makefile,v 1.1
1 2004/08/20 20:13:06 momjian
Exp $
# $PostgreSQL: pgsql/contrib/pgcrypto/Makefile,v 1.1
2 2004/09/14 03:39:48 tgl
Exp $
#
# either 'builtin', 'mhash', 'openssl'
...
...
@@ -82,6 +82,11 @@ include $(top_builddir)/src/Makefile.global
include
$(top_srcdir)/contrib/contrib-global.mk
endif
# to make ws2_32.lib the last library (must occur after definition of PORTNAME)
ifeq
($(PORTNAME),win32)
SHLIB_LINK
+=
-lwsock32
-lws2_32
endif
rijndael.o
:
rijndael.tbl
...
...
contrib/tsearch/gistidx.h
View file @
bf06825e
...
...
@@ -33,6 +33,9 @@ typedef char *BITVECP;
#define GETBIT(x,i) ( (GETBYTE(x,i) >> ( (i) % BITBYTE )) & 0x01 )
#define abs(a) ((a) < (0) ? -(a) : (a))
#ifdef min
#undef min
#endif
#define min(a,b) ((a) < (b) ? (a) : (b))
#define HASHVAL(val) (((unsigned int)(val)) % SIGLENBIT)
#define HASH(sign, val) SETBIT((sign), HASHVAL(val))
...
...
contrib/tsearch/rewrite.c
View file @
bf06825e
...
...
@@ -174,6 +174,9 @@ clean_NOT(ITEM * ptr, int4 *len)
return
plaintree
(
clean_NOT_intree
(
root
),
len
);
}
#ifdef V_UNKNOWN
/* apparently Windows defines this :-( */
#undef V_UNKNOWN
#endif
#define V_UNKNOWN 0
#define V_TRUE 1
#define V_FALSE 2
...
...
contrib/tsearch/txtidx.c
View file @
bf06825e
...
...
@@ -342,11 +342,11 @@ typedef struct
{
uint16
len
;
char
*
word
;
}
WORD
;
}
WORD
_T
;
/* WORD type defined on win32; we'll use WORD_T */
typedef
struct
{
WORD
*
words
;
WORD
_T
*
words
;
int4
lenwords
;
int4
curwords
;
}
PRSTEXT
;
...
...
@@ -369,7 +369,7 @@ parsetext(PRSTEXT * prs, char *buf, int4 buflen)
if
(
prs
->
curwords
==
prs
->
lenwords
)
{
prs
->
lenwords
*=
2
;
prs
->
words
=
(
WORD
*
)
repalloc
((
void
*
)
prs
->
words
,
prs
->
lenwords
*
sizeof
(
WORD
));
prs
->
words
=
(
WORD
_T
*
)
repalloc
((
void
*
)
prs
->
words
,
prs
->
lenwords
*
sizeof
(
WORD_T
));
}
if
(
tokenlen
>
0xffff
)
{
...
...
@@ -410,18 +410,18 @@ parsetext(PRSTEXT * prs, char *buf, int4 buflen)
static
int
compareWORD
(
const
void
*
a
,
const
void
*
b
)
{
if
(((
WORD
*
)
a
)
->
len
==
((
WORD
*
)
b
)
->
len
)
if
(((
WORD
_T
*
)
a
)
->
len
==
((
WORD_T
*
)
b
)
->
len
)
return
strncmp
(
((
WORD
*
)
a
)
->
word
,
((
WORD
*
)
b
)
->
word
,
((
WORD
*
)
b
)
->
len
);
return
(((
WORD
*
)
a
)
->
len
>
((
WORD
*
)
b
)
->
len
)
?
1
:
-
1
;
((
WORD
_T
*
)
a
)
->
word
,
((
WORD
_T
*
)
b
)
->
word
,
((
WORD
_T
*
)
b
)
->
len
);
return
(((
WORD
_T
*
)
a
)
->
len
>
((
WORD_T
*
)
b
)
->
len
)
?
1
:
-
1
;
}
static
int
uniqueWORD
(
WORD
*
a
,
int4
l
)
uniqueWORD
(
WORD
_T
*
a
,
int4
l
)
{
WORD
*
ptr
,
WORD
_T
*
ptr
,
*
res
;
if
(
l
==
1
)
...
...
@@ -430,7 +430,7 @@ uniqueWORD(WORD * a, int4 l)
res
=
a
;
ptr
=
a
+
1
;
qsort
((
void
*
)
a
,
l
,
sizeof
(
WORD
),
compareWORD
);
qsort
((
void
*
)
a
,
l
,
sizeof
(
WORD
_T
),
compareWORD
);
while
(
ptr
-
a
<
l
)
{
...
...
@@ -500,7 +500,7 @@ txt2txtidx(PG_FUNCTION_ARGS)
prs
.
lenwords
=
32
;
prs
.
curwords
=
0
;
prs
.
words
=
(
WORD
*
)
palloc
(
sizeof
(
WORD
)
*
prs
.
lenwords
);
prs
.
words
=
(
WORD
_T
*
)
palloc
(
sizeof
(
WORD_T
)
*
prs
.
lenwords
);
initmorph
();
parsetext
(
&
prs
,
VARDATA
(
in
),
VARSIZE
(
in
)
-
VARHDRSZ
);
...
...
@@ -564,7 +564,7 @@ tsearch(PG_FUNCTION_ARGS)
errmsg
(
"could not find txtidx_field"
)));
prs
.
lenwords
=
32
;
prs
.
curwords
=
0
;
prs
.
words
=
(
WORD
*
)
palloc
(
sizeof
(
WORD
)
*
prs
.
lenwords
);
prs
.
words
=
(
WORD
_T
*
)
palloc
(
sizeof
(
WORD_T
)
*
prs
.
lenwords
);
initmorph
();
/* find all words in indexable column */
...
...
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