Attempt to build using the mingw compiler on Windows XP using the real Sybase libs fails at link stage. Root cause is that the nasty tangle of #ifs in the Sybase csconfig.h header doesn't properly set CS_PUBLIC for this compiler, so header doesn't have the correct __stdcall attributes, causing the linker to fail (.o file has "blk_alloc", .lib has "_blk_alloc").
Attached patch fixes this.... If I understand things, this should also fix similar issues with cygwin and other non-VisualStudio compilers, and should not hurt for VisualStudio, but I have no way of testing this claim.
Patch should not affect FreeTDS users.
I also have no way of knowing inf this is a problem or of testing this patch with other Sybase versions.
Patch for setup.py for NT/mingw for Sybase 12.5 OCS libs
This seems pretty harmless to me, and it is Windows-specific. I'm going to approve this and commit it.
Hmm, Wait a minute. When I look at "csconfig.h" in a 12.5 installation, I don't see any references to _BORLANDC_ but I see references to __BORLANDC__
Why the mismatch?
Oops, you're right. I still had a hacked csconfig.h.
Also, original solution had some warnings as a side-effect, second patch (attached) avoids those, at the cost of possibly breaking real users of Borland C (if there are any left, and which is not supported for Python modules anyway!)