Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit31cf893

Browse files
committed
enable examples to compile on Windows. patch from Hiroshi Saito.
1 parent3c505ef commit31cf893

File tree

3 files changed

+17
-2
lines changed

3 files changed

+17
-2
lines changed

‎src/test/examples/Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ subdir = src/test/examples
66
top_builddir = ../../..
77
include$(top_builddir)/src/Makefile.global
88

9+
ifeq ($(PORTNAME), win32)
10+
LDLIBS += -lws2_32
11+
endif
12+
913
overrideCPPFLAGS := -I$(libpq_srcdir)$(CPPFLAGS)
1014
overrideLDLIBS :=$(libpq_pgport)$(LDLIBS)
1115

‎src/test/examples/testlibpq2.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* $PostgreSQL: pgsql/src/test/examples/testlibpq2.c,v 1.15 2009/06/11 14:49:15 momjian Exp $
2+
* $PostgreSQL: pgsql/src/test/examples/testlibpq2.c,v 1.16 2009/12/31 00:16:47 adunstan Exp $
33
*
44
*
55
* testlibpq2.c
@@ -24,11 +24,16 @@
2424
*
2525
* INSERT INTO TBL1 VALUES (10);
2626
*/
27+
28+
#ifdefWIN32
29+
#include<windows.h>
30+
#endif
2731
#include<stdio.h>
2832
#include<stdlib.h>
2933
#include<string.h>
3034
#include<errno.h>
3135
#include<sys/time.h>
36+
#include<sys/types.h>
3237
#include"libpq-fe.h"
3338

3439
staticvoid

‎src/test/examples/testlibpq3.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* $PostgreSQL: pgsql/src/test/examples/testlibpq3.c,v 1.16 2009/06/11 14:49:15 momjian Exp $
2+
* $PostgreSQL: pgsql/src/test/examples/testlibpq3.c,v 1.17 2009/12/31 00:16:47 adunstan Exp $
33
*
44
*
55
* testlibpq3.c
@@ -25,8 +25,14 @@
2525
*t = (8 bytes) 'ho there'
2626
*b = (5 bytes) \004\003\002\001\000
2727
*/
28+
29+
#ifdefWIN32
30+
#include<windows.h>
31+
#endif
32+
2833
#include<stdio.h>
2934
#include<stdlib.h>
35+
#include<stdint.h>
3036
#include<string.h>
3137
#include<sys/types.h>
3238
#include"libpq-fe.h"

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp