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 MINGW32 errors and warnings #233

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

legends2k
Copy link

  • Include share.h for _SH_DENYNO’s definition
  • Define NOMINMAX only if not already defined; MINGW warns of redefinition since bits/os_defines.h included by <algorithm> already defines it
  • Use C++11 thread_local instead of the non-standard option of __declspec(thread) 1

@legends2k
Copy link
Author

This also fixes #219.

* Include `share.h` for `_SH_DENYNO`’s definition
* Define `NOMINMAX` only if not already defined; MINGW warns of
  redefinition since `bits/os_defines.h` included by `<algorithm>`
  already defines it
* Use C++11 `thread_local` instead of the non-standard option of
  `__declspec(thread)` [1]

[1]: https://learn.microsoft.com/en-us/cpp/cpp/thread?view=msvc-170
@neheb neheb mentioned this pull request Nov 26, 2022
@legends2k
Copy link
Author

legends2k commented Nov 29, 2022

Used thread_local within LOGURU_WINTHREADS macro since both MinGW and MSVC 2015 (7+ years old now) support it.

@emilk Please let me know if you've concerns around this.

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