Commit 31cf8930 authored by Andrew Dunstan's avatar Andrew Dunstan

enable examples to compile on Windows. patch from Hiroshi Saito.

parent 3c505ef5
...@@ -6,6 +6,10 @@ subdir = src/test/examples ...@@ -6,6 +6,10 @@ subdir = src/test/examples
top_builddir = ../../.. top_builddir = ../../..
include $(top_builddir)/src/Makefile.global include $(top_builddir)/src/Makefile.global
ifeq ($(PORTNAME), win32)
LDLIBS += -lws2_32
endif
override CPPFLAGS := -I$(libpq_srcdir) $(CPPFLAGS) override CPPFLAGS := -I$(libpq_srcdir) $(CPPFLAGS)
override LDLIBS := $(libpq_pgport) $(LDLIBS) override LDLIBS := $(libpq_pgport) $(LDLIBS)
......
/* /*
* $PostgreSQL: pgsql/src/test/examples/testlibpq2.c,v 1.15 2009/06/11 14:49:15 momjian Exp $ * $PostgreSQL: pgsql/src/test/examples/testlibpq2.c,v 1.16 2009/12/31 00:16:47 adunstan Exp $
* *
* *
* testlibpq2.c * testlibpq2.c
...@@ -24,11 +24,16 @@ ...@@ -24,11 +24,16 @@
* *
* INSERT INTO TBL1 VALUES (10); * INSERT INTO TBL1 VALUES (10);
*/ */
#ifdef WIN32
#include <windows.h>
#endif
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <errno.h> #include <errno.h>
#include <sys/time.h> #include <sys/time.h>
#include <sys/types.h>
#include "libpq-fe.h" #include "libpq-fe.h"
static void static void
......
/* /*
* $PostgreSQL: pgsql/src/test/examples/testlibpq3.c,v 1.16 2009/06/11 14:49:15 momjian Exp $ * $PostgreSQL: pgsql/src/test/examples/testlibpq3.c,v 1.17 2009/12/31 00:16:47 adunstan Exp $
* *
* *
* testlibpq3.c * testlibpq3.c
...@@ -25,8 +25,14 @@ ...@@ -25,8 +25,14 @@
* t = (8 bytes) 'ho there' * t = (8 bytes) 'ho there'
* b = (5 bytes) \004\003\002\001\000 * b = (5 bytes) \004\003\002\001\000
*/ */
#ifdef WIN32
#include <windows.h>
#endif
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <stdint.h>
#include <string.h> #include <string.h>
#include <sys/types.h> #include <sys/types.h>
#include "libpq-fe.h" #include "libpq-fe.h"
......
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