stdex/include/stdex/windows.h
Simon Rozman 16a86cf350 Add #include wrapper to fix min/max <Windows.h> mess
Signed-off-by: Simon Rozman <simon@rozman.si>
2023-10-18 12:51:49 +02:00

25 lines
492 B
C++

/*
SPDX-License-Identifier: MIT
Copyright © 2023 Amebis
*/
#pragma once
// Windows.h #defines min and max, which collides with std::min and std::max.
// Not only the collision problem, #defining min and max is plain wrong as it
// causes multiple evaluations of parameter expressions.
#ifndef NOMINMAX
#define NOMINMAX
#endif
#include <windows.h>
// In case somebody #included <windows.h> before us without #defining NOMINMAX
#ifdef min
#undef min
#endif
#ifdef max
#undef max
#endif