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

Commit909c519

Browse files
committed
Add missing Windows files.
1 parentd3423da commit909c519

File tree

6 files changed

+176
-0
lines changed

6 files changed

+176
-0
lines changed

‎src/backend/port/dynloader/win.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/* Dummy file used for nothing at this point
2+
*
3+
* see win.h
4+
*/

‎src/backend/port/dynloader/win.h

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/*-------------------------------------------------------------------------
2+
*
3+
* win.h--
4+
* port-specific prototypes for Intel x86/Window NT
5+
*
6+
*
7+
* Copyright (c) 1994, Regents of the University of California
8+
*
9+
* win.h,v 1.2 1995/03/17 06:40:18 andrew Exp
10+
*
11+
*-------------------------------------------------------------------------
12+
*/
13+
#ifndefPORT_PROTOS_H
14+
#definePORT_PROTOS_H
15+
16+
#include<dlfcn.h>
17+
#include"fmgr.h"/* for func_ptr */
18+
#include"utils/dynamic_loader.h"
19+
20+
/* dynloader.c */
21+
/*
22+
* Dynamic Loader on Intel x86/Windows NT
23+
*
24+
* this dynamic loader uses the system dynamic loading interface for shared
25+
* libraries (ie. dlopen/dlsym/dlclose). The user must specify a shared
26+
* library as the file to be dynamically loaded.
27+
*
28+
*/
29+
#definepg_dlopen(f)dlopen(f,1)
30+
#definepg_dlsymdlsym
31+
#definepg_dlclosedlclose
32+
#definepg_dlerrordlerror
33+
34+
#endif/* PORT_PROTOS_H */

‎src/include/port/win.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#defineJMP_BUF
2+
#defineHAS_TEST_AND_SET
3+
typedefunsignedcharslock_t;
4+
5+
#ifndefO_DIROPEN
6+
#defineO_DIROPEN0x100000/* should be in sys/fcntl.h */
7+
#endif

‎src/makefiles/Makefile.win

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
CFLAGS+= -I/usr/local/include
2+
LDFLAGS+= -g
3+
DLLTOOL= dlltool
4+
DLLWRAP= dllwrap
5+
DLLLIBS=-L/usr/local/lib -L$(LIBDIR) -L$(SRCDIR)/backend -lpostgres -lcygipc -lcygwin -lcrypt -lkernel32
6+
X=.exe
7+
MK_NO_LORDER=true
8+
MAKE_DLL=true
9+
#MAKE_DLL=false
10+
SHLIB_LINK=$(DLLLIBS)
11+
12+
%.dll: %.o
13+
$(DLLTOOL) --export-all --output-def $*.def $<
14+
$(DLLWRAP) -o $@ --def $*.def $< $(SRCDIR)/utils/dllinit.o $(DLLLIBS)
15+
rm -f $*.def

‎src/template/cygwin32

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
AROPT:crs
2+
CFLAGS:-O2 -g
3+
SHARED_LIB:
4+
ALL:
5+
SRCH_INC:/usr/local/include
6+
SRCH_LIB:/usr/local/lib
7+
USE_LOCALE:no
8+
DLSUFFIX:.dll
9+
YFLAGS:-d -L /sw/cygwin-b20/share/
10+
YACC:
11+
LIBS:-lcygipc

‎src/utils/dllinit.c

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
/* dllinit.c -- Portable DLL initialization.
2+
Copyright (C) 1998 Free Software Foundation, Inc.
3+
Contributed by Mumit Khan (khan@xraylith.wisc.edu).
4+
5+
I've used DllMain as the DLL "main" since that's the most common
6+
usage. MSVC and Mingw32 both default to DllMain as the standard
7+
callback from the linker entry point. Cygwin32 b19+ uses essentially
8+
the same, albeit slightly differently implemented, scheme. Please
9+
see DECLARE_CYGWIN_DLL macro in <cygwin32/cygwin_dll.h> for more
10+
info on how Cygwin32 uses the callback function.
11+
12+
The real entry point is typically always defined by the runtime
13+
library, and usually never overridden by (casual) user. What you can
14+
override however is the callback routine that the entry point calls,
15+
and this file provides such a callback function, DllMain.
16+
17+
Mingw32: The default entry point for mingw32 is DllMainCRTStartup
18+
which is defined in libmingw32.a This in turn calls DllMain which is
19+
defined here. If not defined, there is a stub in libmingw32.a which
20+
does nothing.
21+
22+
Cygwin32: The default entry point for cygwin32 b19 or newer is
23+
__cygwin32_dll_entry which is defined in libcygwin.a. This in turn
24+
calls the routine you supply to the DECLARE_CYGWIN_DLL (see below)
25+
and, for this example, I've chose DllMain to be consistent with all
26+
the other platforms.
27+
28+
MSVC: MSVC runtime calls DllMain, just like Mingw32.
29+
30+
Summary: If you need to do anything special in DllMain, just add it
31+
here. Otherwise, the default setup should be just fine for 99%+ of
32+
the time. I strongly suggest that you *not* change the entry point,
33+
but rather change DllMain as appropriate.
34+
35+
*/
36+
37+
38+
#defineWIN32_LEAN_AND_MEAN
39+
#include<windows.h>
40+
#undef WIN32_LEAN_AND_MEAN
41+
#include<stdio.h>
42+
43+
BOOLAPIENTRYDllMain (HINSTANCEhInst,DWORDreason,
44+
LPVOIDreserved/* Not used. */ );
45+
46+
#ifdef__CYGWIN32__
47+
48+
#include<cygwin/cygwin_dll.h>
49+
DECLARE_CYGWIN_DLL(DllMain );
50+
/* save hInstance from DllMain */
51+
HINSTANCE__hDllInstance_base;
52+
53+
#endif/* __CYGWIN32__ */
54+
55+
struct_reent*_impure_ptr;
56+
57+
externstruct_reent*__imp_reent_data;
58+
59+
/*
60+
*----------------------------------------------------------------------
61+
*
62+
* DllMain --
63+
*
64+
*This routine is called by the Mingw32, Cygwin32 or VC++ C run
65+
*time library init code, or the Borland DllEntryPoint routine. It
66+
*is responsible for initializing various dynamically loaded
67+
*libraries.
68+
*
69+
* Results:
70+
* TRUE on sucess, FALSE on failure.
71+
*
72+
* Side effects:
73+
*
74+
*----------------------------------------------------------------------
75+
*/
76+
BOOLAPIENTRY
77+
DllMain (
78+
HINSTANCEhInst/* Library instance handle. */ ,
79+
DWORDreason/* Reason this function is being called. */ ,
80+
LPVOIDreserved/* Not used. */ )
81+
{
82+
83+
#ifdef__CYGWIN32__
84+
__hDllInstance_base=hInst;
85+
#endif/* __CYGWIN32__ */
86+
87+
_impure_ptr=__imp_reent_data;
88+
89+
switch (reason)
90+
{
91+
caseDLL_PROCESS_ATTACH:
92+
break;
93+
94+
caseDLL_PROCESS_DETACH:
95+
break;
96+
97+
caseDLL_THREAD_ATTACH:
98+
break;
99+
100+
caseDLL_THREAD_DETACH:
101+
break;
102+
}
103+
return TRUE;
104+
}
105+

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp