Skip to content
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

Windows build #236

Open
aleks-f opened this issue Oct 27, 2023 · 0 comments
Open

Windows build #236

aleks-f opened this issue Oct 27, 2023 · 0 comments

Comments

@aleks-f
Copy link

aleks-f commented Oct 27, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant