Skip to content

Commit

Permalink
Define NOMINMAX when including Windows.h (#81)
Browse files Browse the repository at this point in the history
* Define NOMINMAX when including Windows.h
* Fix some formatting

(cherry picked from commit c5b46c6)
Signed-off-by: Martin Olivier <[email protected]>
  • Loading branch information
DolphyWind authored and martin-olivier committed Jan 4, 2025
1 parent f6695cc commit e725fd6
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions include/dylib.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,20 @@
#if (defined(_WIN32) || defined(_WIN64))
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#define DYLIB_UNDEFINE_LEAN_AND_MEAN
#endif
#ifndef NOMINMAX
#define NOMINMAX
#define DYLIB_UNDEFINE_NOMINMAX
#endif
#include <windows.h>
#ifdef DYLIB_UNDEFINE_LEAN_AND_MEAN
#undef WIN32_LEAN_AND_MEAN
#else
#include <windows.h>
#undef DYLIB_UNDEFINE_LEAN_AND_MEAN
#endif
#ifdef DYLIB_UNDEFINE_NOMINMAX
#undef NOMINMAX
#undef DYLIB_UNDEFINE_NOMINMAX
#endif
#endif

Expand Down

0 comments on commit e725fd6

Please sign in to comment.