Re: cygwin build failure

From: Maarten Boekhold <boekhold(at)emirates(dot)net(dot)ae>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: cygwin build failure
Date: 2004-11-08 14:45:58
Message-ID: 418F86A6.1000805@emirates.net.ae
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

Hi,

Related to the definition of __DLL_IMPORT below, the cygwin port of
glib/gmodule just does the following:

#define G_MODULE_IMPORT extern
#ifdef G_PLATFORM_WIN32
# define G_MODULE_EXPORT __declspec(dllexport)
#else /* !G_PLATFORM_WIN32 */
# define G_MODULE_EXPORT
#endif /* !G_PLATFORM_WIN32 */

Also, it doesn't make any distinction whether you are building a DLL or not.

The following example has been tested and it works (I've done the
example without gmodule, as we wouldn't want to use that within
postgresql anyways):

dll.h:
extern void foo();

dll.c:
#include "dll.h"

__declspec(dllexport) void foo() {
return;
}

main.c:
#include "dll.h"

int main(int argc, char **argv) {
foo();
return 0;
}

This is with recent GCC (3.3.3 on my system), but it probably also works
with older GCC versions.

Don't know if this information is useful in simplying things...

Maarten

Reini Urban wrote:
> #ifdef BUILDING_DLL
> # ifndef __GNUC__
> # define __DLL_IMPORT __declspec(dllimport)
> # else
> # define __DLL_IMPORT __attribute__((dllimport)) extern
> # endif
> #else
> # define __DLL_IMPORT
> #endif

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Marc G. Fournier 2004-11-08 15:21:00 Re: [COMMITTERS] pgsql: Remove: * Allow database recovery where
Previous Message Gaetano Mendola 2004-11-08 13:08:38 Re: NoMovementScanDirection

Browse pgsql-patches by date

  From Date Subject
Next Message John Gray 2004-11-08 14:54:03 Re: contrib/xml2: add function xml_encode_special_chars
Previous Message Andrew Dunstan 2004-11-08 13:07:32 Re: [HACKERS] pg_arch.c call to sleep()