Skip site navigation (1) Skip section navigation (2)

Re: dllmain revisited

From: Juhan Ernits <juhan(at)suhkur(dot)cc(dot)ioc(dot)ee>
To: pgsql-ports(at)postgresql(dot)org
Subject: Re: dllmain revisited
Date: 2000-05-02 00:18:15
Message-ID: 390E1EC7.E921FC1E@cc.ioc.ee (view raw or flat)
Thread:
Lists: pgsql-ports
Think i found the catch:

cygwin_dll.h contains these lines:

#define DECLARE_CYGWIN_DLL(Entry)

CDECL_BEGIN
  int WINAPI _cygwin_dll_entry (HANDLE h, DWORD reason, void *ptr);


Meaning, that lines 43 and 44 in utils/dllinit.c: 

BOOL APIENTRY DllMain(HHINSTANCE hInst, DWORD reason,
                LPVOID reserved /* Not used. */ );

should look like this:

BOOL WINAPI DllMain(HANDLE hInst, DWORD reason,
                void *reserved /* Not used. */ );


And lines 76-80
 
BOOL            APIENTRY
DllMain(
                HINSTANCE hInst /* Library instance handle. */ ,
                DWORD reason /* Reason this function is being called. */
,
                LPVOID reserved /* Not used. */ )

should look like this

BOOL            WINAPI
DllMain(
                HANDLE hInst /* Library instance handle. */ ,
                DWORD reason /* Reason this function is being called. */
,
                void *reserved /* Not used. */ )
                
                LPVOID *reserved /* Not used. */ )

Please correct me if I am wrong.

Juhan Ernits




Juhan Ernits wrote:
> 
> Hello!
> 
> Having read the postings by Sebastian Setzer and Dan HorĂ¡k, it seems,
> that this DLLMAIN problem is not only win95 problem. I have an NT 4.0
> server box running with the latest release of cygwin (v1.1) and gcc
> 2.95.2 and I get the same kind of message about conflicting delcarations
> of dllmain, when trying to compile PG7RC2:
> 
> > I got an error message, complaining that the declaration of
> > DllMain in dllinit.c conflicts with the declaration in
> > cygwin/cygwin_dll.h
> >
> > in cygwin/cygwin_dll.h :
> >  #define DECLARE_CYGWIN_DLL(Entry) \
> >   .... \
> >   int WINAPI Entry (HANDLE h, DWORD reason, void *ptr); \
> >   ...
> > which should expand to :
> > int WINAPI DllMain (HANDLE h, DWORD reason, void *ptr);
> >
> > in dllinit.c :
> > BOOL APIENTRY DllMain(HINSTANCE hInst, DWORD reason, LPVOID reserved);
> 
> Has anybody a clue about the origin of this problem? Trying to remove
> the conflicting declaration only makes things worse ...
> 
> Thanks,
> 
> Juhan Ernits

In response to

pgsql-ports by date

Next:From: Juhan ErnitsDate: 2000-05-02 00:26:56
Subject: undefined reference to _sys_nerr
Previous:From: Juhan ErnitsDate: 2000-05-01 21:31:57
Subject: dllmain revisited

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group