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

Updated README.md indicating the necessity to define the macro MODERN… #214

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

rturrado
Copy link
Contributor

…_SQLITE_STD_OPTIONAL_SUPPORT in order to use null values via std::optional with a C++17 (or later) compiler.

…_SQLITE_STD_OPTIONAL_SUPPORT in order to use null values via std::optional with a C++17 (or later) compiler.
@zauguin
Copy link
Collaborator

zauguin commented Feb 25, 2022

Do you know of any platform where this is required? Normally the library should define this automatically if <optional> is available. It's not intended that the user has to define it manually.

@rturrado
Copy link
Contributor Author

rturrado commented Feb 25, 2022 via email

@zauguin
Copy link
Collaborator

zauguin commented Feb 25, 2022

Thanks. I'm starting to remember: MSVC does not report the language version in __cplusplus so it needs special handling. Could you try the dev branch and see if it works there without manual definition. I think we fixed that over there.

@rturrado
Copy link
Contributor Author

rturrado commented Feb 25, 2022 via email

@zauguin
Copy link
Collaborator

zauguin commented Feb 26, 2022

The hunter source code suggests that VS 2019 is the latest supported version... I guess we should switch to another system, locally I have some issues with hunter too.

For the time being you can just add the hdr directory to your include path and not try to run cmake at all. cmake is only really necessary to run the tests.

@aminroosta aminroosta mentioned this pull request Feb 26, 2022
@rturrado
Copy link
Contributor Author

rturrado commented Feb 27, 2022 via email

@zauguin
Copy link
Collaborator

zauguin commented Feb 27, 2022

Please use code tags for the messages and the code, otherwise it's unreadable (you can do that by placing ``` on a line before and after the output.

@zauguin
Copy link
Collaborator

zauguin commented Feb 27, 2022

Beside that please try the latest dev branch. @aminroosta updated hunter so now it should work on Visual Studio 2022 too and I fixed a typo which probably caused the detection of <optional> to fail.

@rturrado
Copy link
Contributor Author

OK, this is what I've seen:

  1. The check #if (__cplusplus > 201402 || _MSCV_LANG > 201402) && __has_include(<optional>) in type_wrapper.h has a little typo. It says MSCV instead of MSVC.

  2. Apart from that, even when I'm using VS 2022 17.1.0, _MSVC_LANG is defined to 201402 in my system, so that check never defines MODERN_SQLITE_STD_OPTIONAL_SUPPORT.

  3. Changing the check to #if (__cplusplus > 201402 || _MSC_VER > 1900) && __has_include(<optional>) works just fine. #define MODERN_SQLITE_STD_OPTIONAL_SUPPORT is enabled, and the errors I was getting yesterday are no longer there.

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

Successfully merging this pull request may close these issues.

2 participants