--- code/trunk/pcre.h 2007/02/24 21:39:09 37 +++ code/trunk/pcre.h 2007/02/24 21:39:13 39 @@ -7,6 +7,22 @@ #ifndef _PCRE_H #define _PCRE_H +#define PCRE_MAJOR 2 +#define PCRE_MINOR 08 +#define PCRE_DATE 31-Aug-1999 + +/* Win32 uses DLL by default */ + +#ifdef _WIN32 +# ifdef STATIC +# define PCRE_DL_IMPORT +# else +# define PCRE_DL_IMPORT __declspec(dllimport) +# endif +#else +# define PCRE_DL_IMPORT +#endif + /* Have to include stdlib.h in order to ensure that size_t is defined; it is needed here for malloc. */ @@ -49,10 +65,13 @@ typedef void pcre_extra; /* Store get and free functions. These can be set to alternative malloc/free -functions if required. */ +functions if required. Some magic is required for Win32 DLL; it is null on +other OS. */ + +PCRE_DL_IMPORT extern void *(*pcre_malloc)(size_t); +PCRE_DL_IMPORT extern void (*pcre_free)(void *); -extern void *(*pcre_malloc)(size_t); -extern void (*pcre_free)(void *); +#undef PCRE_DL_IMPORT /* Functions */