Fix Windows header conflicts with termcolor library
Add WIN32_LEAN_AND_MEAN and NOMINMAX defines before including Windows headers to prevent macro conflicts (especially min/max macros) with C++ standard library and termcolor dependencies. Changes: - examples/cli/cli.cpp: Reorder includes and add Windows defines - src/whisper.cpp: Add Windows defines at the top of the file
This commit is contained in:
parent
999a7e0cbf
commit
2755df56f5
|
|
@ -15,9 +15,15 @@
|
|||
#include <cfloat>
|
||||
|
||||
#if defined(_WIN32)
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#ifndef NOMINMAX
|
||||
#define NOMINMAX
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <termcolor/termcolor.hpp>
|
||||
|
||||
#if defined(_WIN32)
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,10 @@
|
|||
#ifdef _WIN32
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#ifndef NOMINMAX
|
||||
#define NOMINMAX
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include "whisper.h"
|
||||
#include "whisper-arch.h"
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue