Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit f13cb7e

Browse files
committed
Fixes to make ecpg work on Cygwin, from Jason Tishler <Jason.Tishler@dothill.com>.
1 parent b95ff0c commit f13cb7e

File tree

3 files changed

+17
-4
lines changed

3 files changed

+17
-4
lines changed

src/interfaces/ecpg/include/sqlca.h

+9-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
#ifndef POSTGRES_SQLCA_H
22
#define POSTGRES_SQLCA_H
33

4+
#ifndef DLLIMPORT
5+
#ifdef __CYGWIN__
6+
#define DLLIMPORT __declspec (dllimport)
7+
#else
8+
#define DLLIMPORT
9+
#endif /* __CYGWIN__ */
10+
#endif /* DLLIMPORT */
11+
412
#define SQLERRMC_LEN 70
513

614
#ifdef __cplusplus
@@ -45,7 +53,7 @@ extern "C"
4553
char sqlext[8];
4654
};
4755

48-
extern struct sqlca sqlca;
56+
extern DLLIMPORT struct sqlca sqlca;
4957

5058

5159
#ifdef __cplusplus

src/interfaces/ecpg/test/Makefile

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
all: test1 test2 test3 test4 perftest dyntest dyntest2 test_notice test_code100 test_init
22

33
#LDFLAGS=-g -I /usr/local/pgsql/include -L/usr/local/pgsql/lib -lecpg -lpq
4-
LDFLAGS=-g -I ../include -I /usr/include/postgresql -L /usr/lib -lecpg -lpq
4+
LDFLAGS=-g -I ../include
5+
LDLIBS=-L ../lib -lecpg -L ../../libpq -lpq
56

67
#ECPG=/usr/local/pgsql/bin/ecpg -I../include
78
ECPG=../preproc/ecpg -I../include
@@ -24,4 +25,4 @@ test_text: test_text.c
2425
$(ECPG) $?
2526

2627
clean:
27-
rm -f test1 test2 test3 test4 perftest *.c log dyntest dyntest2 test_notice test_code100 test_init test_text
28+
rm -f test1 test2 test3 test4 perftest *.c log dyntest dyntest2 test_notice test_code100 test_init test_text *.exe

src/makefiles/Makefile.win

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# $Header: /cvsroot/pgsql/src/makefiles/Attic/Makefile.win,v 1.10 2001/04/04 21:15:56 tgl Exp $
1+
# $Header: /cvsroot/pgsql/src/makefiles/Attic/Makefile.win,v 1.11 2001/05/03 16:07:52 tgl Exp $
22
LDFLAGS+= -g
33
DLLTOOL= dlltool
44
DLLWRAP= dllwrap
@@ -23,3 +23,7 @@ CFLAGS_SL =
2323
ifeq ($(findstring backend,$(subdir)), backend)
2424
override CPPFLAGS+= -DBUILDING_DLL=1
2525
endif
26+
27+
ifeq ($(findstring ecpg/lib,$(subdir)), ecpg/lib)
28+
override CPPFLAGS+= -DBUILDING_DLL=1
29+
endif

0 commit comments

Comments
 (0)