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

Fix msvc build -- STRICT is a msvc macro name #450

Merged
merged 2 commits into from
Sep 6, 2023

Conversation

nyalldawson
Copy link
Contributor

Follow up #445

@syoyo
Copy link
Owner

syoyo commented Sep 3, 2023

MSVC CI build passes. #445

What is the error message?

@nyalldawson
Copy link
Contributor Author

Sorry, it's actually the msys build which has issues with this name. See eg https://github.com/qgis/QGIS/actions/runs/6060705066/job/16445155328

@syoyo
Copy link
Owner

syoyo commented Sep 4, 2023

I see. it'd be better to add msys2 + MinGW(ucrt) CI to tinygltf's Github Actions before merging this PR.

@nyalldawson
Copy link
Contributor Author

Ok, #451 adds that. BUT it passes, and it turns out it's not part of the mingw build itself which is defining this macro.

It must be coming from one of the dependencies in the project. (There's some hefty ones there, like Qt and GDAL which have hundreds of dependencies themselves). A quick code scan on github shows a number of projects defining this macro: https://github.com/search?q=%22%23Define+strict+%22&type=code&p=1

More details here: https://learn.microsoft.com/en-au/windows/win32/winprog/enabling-strict?redirectedfrom=MSDN

@syoyo
Copy link
Owner

syoyo commented Sep 6, 2023

I see.

I think it'd be better to add suffix(or prefix) to enum identifier or only capitalize the first character to avoid potential conflict of any macro names. How do you think?

  typedef enum {
    STRICTNESS_PERMISSIVE,
    STRICTNESS_STRICT,
  } ParseStrictness;

  // or

  typedef enum {
    Permissive,
    Strict,
  } ParseStrictness;

@nyalldawson
Copy link
Contributor Author

@syoyo

I think it'd be better to add suffix(or prefix) to enum identifier or only capitalize the first character to avoid potential conflict of any macro names. How do you think?

Ok, done. I've gone with the capitalization change to avoid any risk.

@syoyo syoyo merged commit fe6a182 into syoyo:release Sep 6, 2023
7 checks passed
@syoyo
Copy link
Owner

syoyo commented Sep 6, 2023

Brilliant! Thanks! Merged! > I've gone with the capitalization change to avoid any risk.

@nyalldawson nyalldawson mentioned this pull request Sep 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants