-
Notifications
You must be signed in to change notification settings - Fork 251
Description
I managed to compile and run on windows, here are the changes
this should be in a header included by all public-facing files (there seems to be no such top-level header currently):
#if defined(_WIN32)
#if defined(_MSC_VER)
#define strncasecmp _strnicmp
#define strcasecmp _stricmp
#endif
#if defined(SQLParser_EXPORTS)
#define SQLParser_API __declspec(dllexport)
#else
#define SQLParser_API __declspec(dllimport)
#endif
#endif
and then all exported structs, classes , enums, and functions should be declared with it, eg:
struct SQLParser_API SQLStatement {
// ...
}
In flex_lexer.h
, I "quick and dirty" added #include <io.h>
:
#ifndef YY_NO_UNISTD_H
/* Special case for "unistd.h", since it is non-ANSI. We include it way
* down here because we want the user's section 1 to have been scanned first.
* The user has a chance to override it with an option.
*/
#if defined(_WIN32) || defined(_WIN64)
#include <io.h>
#else
#include <unistd.h>
#endif
#endif
And that was it - it works on Windows.
I could send a PR, but we need this properly multi-platformed and some features supported, most notably stored procedures. If there is anyone on the project team here interested in some paid project work, please contact me at(alex, dot(pocoproject, org)
EDIT: there's also this problem on Windows with SQLParserResult::statements_
and SQLParserResult::parameters_
. I tried this solution and it seems to work fine.