Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
62636a3d
Commit
62636a3d
authored
Nov 02, 2002
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Re-add Win32 missing files, I think.
parent
a89660a1
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
126 additions
and
0 deletions
+126
-0
src/utils/Makefile
src/utils/Makefile
+18
-0
src/utils/dllinit.c
src/utils/dllinit.c
+108
-0
No files found.
src/utils/Makefile
View file @
62636a3d
#-------------------------------------------------------------------------
#
# Makefile for utils
#
# $Header: /cvsroot/pgsql/src/utils/Attic/Makefile,v 1.19 2002/11/02 02:00:35 momjian Exp $
#
# dllinit.o is only built on Win32 platform.
#
#-------------------------------------------------------------------------
subdir
=
src/utils
top_builddir
=
../..
include
$(top_builddir)/src/Makefile.global
all
:
clean distclean maintainer-clean
:
rm
-f
dllinit.o
src/utils/dllinit.c
View file @
62636a3d
#include <cygwin/version.h>
#if CYGWIN_VERSION_DLL_MAJOR < 1001
/* dllinit.c -- Portable DLL initialization.
Copyright (C) 1998 Free Software Foundation, Inc.
Contributed by Mumit Khan (khan@xraylith.wisc.edu).
I've used DllMain as the DLL "main" since that's the most common
usage. MSVC and Mingw32 both default to DllMain as the standard
callback from the linker entry point. Cygwin32 b19+ uses essentially
the same, albeit slightly differently implemented, scheme. Please
see DECLARE_CYGWIN_DLL macro in <cygwin32/cygwin_dll.h> for more
info on how Cygwin32 uses the callback function.
The real entry point is typically always defined by the runtime
library, and usually never overridden by (casual) user. What you can
override however is the callback routine that the entry point calls,
and this file provides such a callback function, DllMain.
Mingw32: The default entry point for mingw32 is DllMainCRTStartup
which is defined in libmingw32.a This in turn calls DllMain which is
defined here. If not defined, there is a stub in libmingw32.a which
does nothing.
Cygwin32: The default entry point for cygwin32 b19 or newer is
__cygwin32_dll_entry which is defined in libcygwin.a. This in turn
calls the routine you supply to the DECLARE_CYGWIN_DLL (see below)
and, for this example, I've chose DllMain to be consistent with all
the other platforms.
MSVC: MSVC runtime calls DllMain, just like Mingw32.
Summary: If you need to do anything special in DllMain, just add it
here. Otherwise, the default setup should be just fine for 99%+ of
the time. I strongly suggest that you *not* change the entry point,
but rather change DllMain as appropriate.
*/
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#undef WIN32_LEAN_AND_MEAN
#include <stdio.h>
BOOL
APIENTRY
DllMain
(
HINSTANCE
hInst
,
DWORD
reason
,
LPVOID
reserved
/* Not used. */
);
#ifdef __CYGWIN__
#include <cygwin/cygwin_dll.h>
DECLARE_CYGWIN_DLL
(
DllMain
);
/* save hInstance from DllMain */
HINSTANCE
__hDllInstance_base
;
#endif
/* __CYGWIN__ */
struct
_reent
*
_impure_ptr
;
extern
struct
_reent
*
__imp_reent_data
;
/*
*----------------------------------------------------------------------
*
* DllMain
*
* This routine is called by the Mingw32, Cygwin32 or VC++ C run
* time library init code, or the Borland DllEntryPoint routine. It
* is responsible for initializing various dynamically loaded
* libraries.
*
* Results:
* TRUE on sucess, FALSE on failure.
*
* Side effects:
*
*----------------------------------------------------------------------
*/
BOOL
APIENTRY
DllMain
(
HINSTANCE
hInst
/* Library instance handle. */
,
DWORD
reason
/* Reason this function is being called. */
,
LPVOID
reserved
/* Not used. */
)
{
#ifdef __CYGWIN__
__hDllInstance_base
=
hInst
;
#endif
/* __CYGWIN__ */
_impure_ptr
=
__imp_reent_data
;
switch
(
reason
)
{
case
DLL_PROCESS_ATTACH
:
break
;
case
DLL_PROCESS_DETACH
:
break
;
case
DLL_THREAD_ATTACH
:
break
;
case
DLL_THREAD_DETACH
:
break
;
}
return
TRUE
;
}
#endif
/* CYGWIN_VERSION_DLL_MAJOR < 1001 */
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment