-
Notifications
You must be signed in to change notification settings - Fork 164
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Address Windows build errors, most config-dependent. #568
base: master
Are you sure you want to change the base?
Conversation
* In the absence of an external SQLGetPrivateProfileString, fail the build only when expecting to use an external driver manager, and expose tds_SQLGetPrivateProfileString to the odbc "connect" unit test. Don't let that test attempt to use SQLGetPrivateProfileStringW even in Unicode builds. * src/odbc/win*.c: Accommodate static builds, with no hinstFreeTDS; in particular, never attempt to show FreeTDS dialog boxes there. * src/utils/unittests/challenge.c: #include <freetds/sysdep_private.h> to ensure the availability of strcasecmp. Signed-off-by: Aaron M. Ucko <[email protected]>
@@ -556,7 +560,7 @@ odbc_build_connect_string(TDS_ERRS *errs, TDS_PARSED_PARAM *params, char **out) | |||
|
|||
#if !HAVE_SQLGETPRIVATEPROFILESTRING | |||
|
|||
#ifdef _WIN32 | |||
#if defined(_WIN32) && !defined(TDS_NO_DM) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Personally I would avoid this, Windows has a standard driver manager which should be used
I acknowledge that bypassing Windows' native DM is unconventional, but it's logistically simpler to use driverless mode everywhere than to arrange to link this API's tests directly against it only in the absence of a system DM. (The C++ Toolkit's build system covers bundled projects itself rather than using their own build systems.) I also seem to recall that the system DM insisted on sticking to drivers that had been registered system-wide, but perhaps that's not actually a problem, at least nowadays. |
Reasonable. About the UPDATE: other parts of the |
AFAICT, that part of the test does actually succeed with this change in place, at least if I point the test at appropriate |
#if !HAVE_SQLGETPRIVATEPROFILESTRING | ||
# define SQLGetPrivateProfileString tds_SQLGetPrivateProfileString | ||
int tds_SQLGetPrivateProfileString(LPCSTR pszSection, LPCSTR pszEntry, | ||
LPCSTR pszDefault, LPSTR pRetBuffer, | ||
int nRetBuffer, LPCSTR pszFileName); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens if we use a DLL here? I would assume this test will refer to an undefined symbol and fail to load.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, yeah, (conditional) exporting is in order here. However, I need a static build anyway for the sake of the all_types
, connection_string_parse
, and utf8_4
tests, so our Windows builds leave this library static-only for simplicity.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tried to sort out this last hunk. Maybe code for that specific function could be just duplicated somehow? I tried to build for Windows and SQLGetPrivateProfileString
from odbc system libraries was used, not the version from shared library.
I've added CMake tuneups I'd missed earlier and rebased against |
to ensure the availability of strcasecmp.
Split from #555.