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:
Oleg Orlov 2025-11-01 21:07:25 +03:00
parent 999a7e0cbf
commit 2755df56f5
2 changed files with 13 additions and 0 deletions

View File

@ -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

View File

@ -1,3 +1,10 @@
#ifdef _WIN32
#define WIN32_LEAN_AND_MEAN
#ifndef NOMINMAX
#define NOMINMAX
#endif
#endif
#include "whisper.h"
#include "whisper-arch.h"