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

Commitf34240d

Browse files
committed
Changes to fix/improve the dynamic loading on NTFrom: Horak Daniel <horak@mmp.plzen-city.cz>
1 parentf7430af commitf34240d

File tree

6 files changed

+33
-10
lines changed

6 files changed

+33
-10
lines changed

‎src/backend/commands/trigger.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
#include"utils/acl.h"
3636
#endif
3737

38-
TriggerData*CurrentTriggerData=NULL;
38+
DLLIMPORTTriggerData*CurrentTriggerData=NULL;
3939

4040
voidRelationBuildTriggers(Relationrelation);
4141
voidFreeTriggerDesc(Relationrelation);

‎src/backend/executor/spi.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* spi.c
44
*Server Programming Interface
55
*
6-
* $Id: spi.c,v 1.34 1999/02/13 23:15:30 momjian Exp $
6+
* $Id: spi.c,v 1.35 1999/03/09 13:39:00 scrappy Exp $
77
*
88
*-------------------------------------------------------------------------
99
*/
@@ -19,9 +19,9 @@ static _SPI_connection *_SPI_current = NULL;
1919
staticint_SPI_connected=-1;
2020
staticint_SPI_curid=-1;
2121

22-
uint32SPI_processed=0;
23-
SPITupleTable*SPI_tuptable;
24-
intSPI_result;
22+
DLLIMPORTuint32SPI_processed=0;
23+
DLLIMPORTSPITupleTable*SPI_tuptable;
24+
DLLIMPORTintSPI_result;
2525

2626
staticint_SPI_execute(char*src,inttcount,_SPI_plan*plan);
2727
staticint_SPI_pquery(QueryDesc*queryDesc,EState*state,inttcount);

‎src/include/c.h

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
* Copyright (c) 1994, Regents of the University of California
99
*
10-
* $Id: c.h,v 1.51 1999/02/13 23:20:44 momjian Exp $
10+
* $Id: c.h,v 1.52 1999/03/09 13:39:01 scrappy Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -57,6 +57,10 @@
5757
#include<errno.h>
5858
#endif
5959

60+
#ifdef__CYGWIN32__
61+
#include<errno.h>
62+
#endif
63+
6064
/* ----------------------------------------------------------------
6165
*Section 1:bool, true, false, TRUE, FALSE
6266
* ----------------------------------------------------------------
@@ -829,6 +833,20 @@ extern char *form(const char *fmt,...);
829833
#defineCOPY_CMD"cp"
830834
#defineSEP_CHAR'/'
831835

836+
/* defines for dynamic linking on Win32 platform */
837+
#ifdef__CYGWIN32__
838+
#if__GNUC__&& ! defined (__declspec)
839+
#error You need egcs 1.1 or newer for compiling!
840+
#endif
841+
#ifdefBUILDING_DLL
842+
#defineDLLIMPORT __declspec (dllexport)
843+
#else/* not BUILDING_DLL */
844+
#defineDLLIMPORT __declspec (dllimport)
845+
#endif
846+
#else/* not CYGWIN */
847+
#defineDLLIMPORT
848+
#endif
849+
832850
/* Provide prototypes for routines not present in a particular machine's
833851
* standard C library. It'd be better to put these in config.h, but
834852
* in config.h we haven't yet included anything that defines size_t...

‎src/include/commands/trigger.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ typedef struct TriggerData
2626
Trigger*tg_trigger;
2727
}TriggerData;
2828

29-
externTriggerData*CurrentTriggerData;
29+
externDLLIMPORTTriggerData*CurrentTriggerData;
3030

3131
#defineTRIGGER_EVENT_INSERT0x00000000
3232
#defineTRIGGER_EVENT_DELETE0x00000001

‎src/include/executor/spi.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,9 @@ typedef struct
6666
#defineSPI_OK_UPDATE9
6767
#defineSPI_OK_CURSOR10
6868

69-
externuint32SPI_processed;
70-
externSPITupleTable*SPI_tuptable;
71-
externintSPI_result;
69+
externDLLIMPORTuint32SPI_processed;
70+
externDLLIMPORTSPITupleTable*SPI_tuptable;
71+
externDLLIMPORTintSPI_result;
7272

7373
externintSPI_connect(void);
7474
externintSPI_finish(void);

‎src/makefiles/Makefile.win

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,8 @@ SHLIB_LINK=$(DLLLIBS)
1313
$(DLLTOOL) --export-all --output-def $*.def $<
1414
$(DLLWRAP) -o $@ --def $*.def $< $(SRCDIR)/utils/dllinit.o $(DLLLIBS)
1515
rm -f $*.def
16+
17+
curdir:=$(shell pwd)
18+
ifeq ($(findstring backend,$(curdir)), backend)
19+
CFLAGS+= -DBUILDING_DLL=1
20+
endif

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp