Skip to content

Commit 31cf893

Browse files
committed
enable examples to compile on Windows. patch from Hiroshi Saito.
1 parent 3c505ef commit 31cf893

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
override CPPFLAGS := -I$(libpq_srcdir) $(CPPFLAGS)
1014
override LDLIBS := $(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+
#ifdef WIN32
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
static void

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+
#ifdef WIN32
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy