chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Chicken-users] dll import libs for MinGW


From: Brandon J. Van Every
Subject: [Chicken-users] dll import libs for MinGW
Date: Tue, 07 Feb 2006 18:31:52 -0800
User-agent: Thunderbird 1.5 (Windows/20051201)

I have been scratching my head wondering why my CMake build doesn't generate any dll import libraries with MinGW. I find that chicken.h has lines about __declspec(dllexport) that look wrong. It appears that this is done only for MSVC compilers. I don't think this is correct. In particular, MinGW is not at all like Cygwin. The relevant section is:

#define C_varextern                C_extern
#define C_fctimport
#define C_fctexport
#define C_externimport             C_extern
#define C_externexport             C_extern
#if !(defined(C_NO_PIC_NO_DLL) && !defined(PIC))
# if defined(__CYGWIN__) || defined(__MINGW32__)
#  ifndef C_BUILDING_LIBCHICKEN
#   undef  C_varextern
#   define C_varextern             C_extern __declspec(dllimport)
#  endif
# elif defined(_MSC_VER)
#  undef  C_fctimport
#  define C_fctimport              __declspec(dllexport)
#  undef  C_externimport
#  undef  C_externexport
#  define C_externimport           C_extern __declspec(dllimport)
#  define C_externexport           C_extern __declspec(dllexport)
#  undef  C_varextern
#  undef  C_fctexport
#  ifdef C_BUILDING_LIBCHICKEN
#   define C_varextern             C_extern __declspec(dllexport)
#   define C_fctexport             __declspec(dllexport)
#  else
#   define C_varextern             C_extern __declspec(dllimport)
#   define C_fctexport             __declspec(dllimport)
#  endif
# endif
#endif

Furthermore, this may explain the Platform SDK dependency. Because Microsoft is a pile of pricks, whenever I run the PSDK setup, it automagically searches for MSVC and adds paths for that. Totally not what I want for a MinGW / MSYS setup, but as a side effect, _MSC_VER gets defined.

The fix might be as simple as

# if defined(__CYGWIN__)
...
# elif defined(_MSC_VER) || defined(__MINGW32__)

but I am wondering if there are other places in the Chicken sources that have the same problem. I've sorta reached my head scratching limit for the day and thought I'd get some input.


Cheers,
Brandon Van Every






reply via email to

[Prev in Thread] Current Thread [Next in Thread]