Judy builds under my build system now, and is incorporated
in Felix, along with a Felix wrapper. Thanks!
I haven't tried to build Judy on Windows yet, but there's
one issue that will arise.
On Windows, one needs to dllexport symbols when building
a DLL, and dllimport when using that dll. The usual technique
for doing this is similar to this:
1. In a standard file you define:
#if defined(_WIN32) && !defined(STATIC_LINKAGE)
#define DLL_EXPORT __declspec(dllexport)
#define DLL_IMPORT __declspec(dllimport)
#else
#define DLL_EXPORT
#define DLL_IMPORT
#endif
2. In the header file for the library, you import
the standard header file above and define:
#ifdef BUILD_JUDY
#define JUDY_EXTERN DLL_EXPORT
#else
#define JUDY_EXTERN DLL_IMPORT
#endif
3. Each public function is declared like:
void JUDY_EXTERN f(int);
4. When compiling the implementation of the library, the compiler switch
-DBUILD_JUDY
is given. When using the library, no switch is given.
There must be a 1-1 correspondence between DLLs and the build
macro name, so Judy.dll can use name JUDY, and some other
library other.dll uses macro name OTHER.
Although MSVC++ can export ALL names, and, you can also use .DEF
files to do it, the above is the proper way, but unfortunately
it *is* invasive, requiring software vendors to modify source
code to include the JUDY_EXTERN in front of the names of all
public functions.
There are many variations on this of course, the above
is roughly what I use.
Luckily, I can probably patch the Judy sources by searching
for FUNCTION followed by one of the public function names
on the same line (the FUNCTION macro is a real saviour!)
I'll let you all know a bit later (when i get around to trying it)
how it goes with MSVC++.
--
John Skaller <skaller at users dot sf dot net>
Felix, successor to C++: http://felix.sf.net
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Judy-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/judy-devel