Thomas Briggs wrote:



From the looks of this warning, I would guess that you could redefine
SQLITE_STATIC like this (or some variation of this that is legal C++) to solve
the problem:


#define SQLITE_STATIC ((extern "C" void(*)(void*)) 0)


   I don't think there's any legal way to do this, is there?  Linkage
is, well, a linker issue; this is a passing-a-function-pointer issue.
It doesn't seem sensible to me that you would/should be able to specify
the linkage for a function as you're passing around a pointer to that
function around.

As I recall, there's no truly portable way in C or C++ to do any sort of conversion involving pointers to functions. Even if you turn around and convert it back to the original type, you may get a different value because some platforms lose data. This is a side-effect of allowing fat pointers.


That being said, this code should work fine on nearly all platforms, since we're dealing with a special value of zero rather than actually attempting to call a real function.
--
http://www.velocityvector.com/ | http://glmiller.blogspot.com/
http://www.classic-games.com/ |
Linux is UNIX for Windows users. BSD is UNIX for UNIX users.

Reply via email to