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
  • Loading branch information
DolphyWind authored Feb 26, 2024
1 parent d848a2f commit c5b46c6
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 @@ -24,10 +24,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
#else
#include <dlfcn.h>
Expand Down

0 comments on commit c5b46c6

Please sign in to comment.