Skip to content

logs: fix mingw-like builds (fixes #2898) - #2911

Merged
ggerganov merged 5 commits into
ggml-org:masterfrom
staviq:betterlogs_fixes
Sep 1, 2023
Merged

ggerganov merged 5 commits into
ggml-org:masterfrom
staviq:betterlogs_fixes

Conversation

@staviq

@staviq staviq commented Aug 30, 2023 •

Copy link
Copy Markdown
Contributor

Fixes #2898

Using _WIN32 does not work with mingw and similar build environments, and check for __MINGW32__ is necessary in that case. Better and simpler Windows detection via _MSC_VER.

If mingw/msys like build environments are supported, this should probably get fixed in other parts of the project too, because currently it produces compile warnings.

Edit:
Fixes #2940 too.

@cebtenzzre

Copy link
Copy Markdown
Collaborator

I think you want the _MSC_VER macro - that's how you identify MSVC.

@cebtenzzre

Copy link
Copy Markdown
Collaborator

What I mean is, instead of checking for Windows or MinGW or using this LOG_COMPAT macro, just check for MSVC. It's a compiler problem, not an OS problem - _WIN32 has nothing to do with it, and the code shouldn't care whether it's gcc on Linux or Windows.

Comment thread common/log.h Resolved
@staviq

staviq commented Aug 31, 2023

Copy link
Copy Markdown
Contributor Author

@cebtenzzre should I add fix for #2940 here ? It's quite simple.

@cebtenzzre

Copy link
Copy Markdown
Collaborator

should I add fix for #2940 here ?

Sure, why not. I independently discovered and fixed that in #2886, but this might get merged first.

@ggerganov
ggerganov merged commit 4dcd47d into ggml-org:master Sep 1, 2023
Seunghhon pushed a commit to Seunghhon/llama.cpp that referenced this pull request Apr 26, 2026
* fix mingw-like builds

* formatting

* make LOG_COMPAT easier to override and extend

* simplify win detection

* fix for ggml-org#2940
phuongncn pushed a commit to phuongncn/llama.cpp-gx10-dgx-sparks-deepseekv4 that referenced this pull request Apr 28, 2026
* fix mingw-like builds

* formatting

* make LOG_COMPAT easier to override and extend

* simplify win detection

* fix for ggml-org#2940
ljubomirj pushed a commit to ljubomirj/llama.cpp that referenced this pull request May 6, 2026
* fix mingw-like builds

* formatting

* make LOG_COMPAT easier to override and extend

* simplify win detection

* fix for ggml-org#2940
AlexiAlp pushed a commit to minghaop/llama.cpp that referenced this pull request Jun 2, 2026
* fix mingw-like builds

* formatting

* make LOG_COMPAT easier to override and extend

* simplify win detection

* fix for ggml-org#2940
AlexiAlp pushed a commit to minghaop/llama.cpp that referenced this pull request Jun 2, 2026
* fix mingw-like builds

* formatting

* make LOG_COMPAT easier to override and extend

* simplify win detection

* fix for ggml-org#2940
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants