libftdi Archives

Subject: Re: Compiling libftdi with MSVC on Windows

From: Thomas Jarosch <thomas.jarosch@xxxxxxxxxxxxx>
To: libftdi@xxxxxxxxxxxxxxxxxxxxxxx
Cc: Thomas Heller <theller@xxxxxxxxxx>
Date: Fri, 13 Apr 2012 15:22:32 +0200

Hi Thomas,


I'm willing to accept such a patch. I think that using "EXPORT"

as macro name will clash sooner or later.


I've looked at other projects (gd, Qt, pcre). They use something like this:


-------------------------------------------------------------

/* When an application links to a PCRE DLL in Windows, the symbols that are

imported have to be identified as such. When building PCRE, the appropriate

export settings are needed, and are set in pcreposix.c before including this

file. */


#if defined(_WIN32) && !defined(PCRE_STATIC) && !defined(PCREPOSIX_EXP_DECL)

# define PCREPOSIX_EXP_DECL extern __declspec(dllimport)

# define PCREPOSIX_EXP_DEFN __declspec(dllimport)

#endif


...



PCREPOSIX_EXP_DECL int regcomp(regex_t *, const char *, int);

PCREPOSIX_EXP_DECL int regexec(const regex_t *, const char *, size_t,

regmatch_t *, int);

PCREPOSIX_EXP_DECL size_t regerror(int, const regex_t *, char *, size_t);

PCREPOSIX_EXP_DECL void regfree(regex_t *);

-------------------------------------------------------------



Would such a wrapper work for you / libftdi, too?


Cheers,

Thomas




libftdi - see http://www.intra2net.com/en/developer/libftdi for details.
To unsubscribe send a mail to libftdi+unsubscribe@xxxxxxxxxxxxxxxxxxxxxxx


Current Thread