examples_win32_patch2

application/octet-stream

Filename: examples_win32_patch2
Type: application/octet-stream
Part: 0
Message: Re: test/example does not support win32.
*** src/test/examples/Makefile.orig	Wed Dec 30 13:30:13 2009
--- src/test/examples/Makefile	Thu Dec 31 00:08:39 2009
***************
*** 6,13 ****
  top_builddir = ../../..
  include $(top_builddir)/src/Makefile.global
  
  override CPPFLAGS := -I$(libpq_srcdir) $(CPPFLAGS)
! override LDLIBS := $(libpq_pgport) $(LDLIBS)
  
  
  PROGS = testlibpq testlibpq2 testlibpq3 testlibpq4 testlo
--- 6,17 ----
  top_builddir = ../../..
  include $(top_builddir)/src/Makefile.global
  
+ ifeq ($(PORTNAME), win32)
+ LDLIBS += -lws2_32
+ endif
+ 
  override CPPFLAGS := -I$(libpq_srcdir) $(CPPFLAGS)
! override LDLIBS := $(libpq_pgport) $(LDLIBS) -DFRONTEND 
  
  
  PROGS = testlibpq testlibpq2 testlibpq3 testlibpq4 testlo
*** src/test/examples/testlibpq2.c.orig	Wed Dec 30 13:19:03 2009
--- src/test/examples/testlibpq2.c	Thu Dec 31 00:52:52 2009
***************
*** 24,34 ****
--- 24,39 ----
   *
   *	 INSERT INTO TBL1 VALUES (10);
   */
+ 
+ #ifdef WIN32
+ #include <windows.h>
+ #endif
  #include <stdio.h>
  #include <stdlib.h>
  #include <string.h>
  #include <errno.h>
  #include <sys/time.h>
+ #include <sys/types.h>
  #include "libpq-fe.h"
  
  static void
*** src/test/examples/testlibpq3.c.orig	Thu Dec 31 01:14:54 2009
--- src/test/examples/testlibpq3.c	Thu Dec 31 01:12:20 2009
***************
*** 25,32 ****
--- 25,38 ----
   *	t = (8 bytes) 'ho there'
   *	b = (5 bytes) \004\003\002\001\000
   */
+ 
+ #ifdef WIN32
+ #include <windows.h>
+ #endif
+ 
  #include <stdio.h>
  #include <stdlib.h>
+ #include <stdint.h>
  #include <string.h>
  #include <sys/types.h>
  #include "libpq-fe.h"