Skip to content

Commit

Permalink
fix windows build
Browse files Browse the repository at this point in the history
  • Loading branch information
khanghugo committed Apr 4, 2024
1 parent f2ec7a4 commit 8a8f1b2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/sdhlt/sdHLVIS/vis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,13 @@
#ifdef SYSTEM_WIN32
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
// std:clamp() is at least MVSC 19
#define CLAMP(x, min, max) x <= min ? min : x >= max ? max : x
#endif

#ifdef SYSTEM_POSIX
#include <algorithm>
#define CLAMP(x, min, max) std::clamp(x, min, max)
#endif

#ifdef ZHLT_NETVIS
Expand Down Expand Up @@ -1877,7 +1880,7 @@ int main(const int argc, char** argv)

GetVectorForKey (&g_entities[i], "origin", room_origin);
g_room[g_room_count].visleafnum = VisLeafnumForPoint (room_origin);
g_room[g_room_count].neighbor = std::clamp(IntForKey (&g_entities[i], "neighbor"), 0, MAX_ROOM_NEIGHBOR);
g_room[g_room_count].neighbor = CLAMP(IntForKey (&g_entities[i], "neighbor"), 0, MAX_ROOM_NEIGHBOR);

const char* target = ValueForKey (&g_entities[i], "target");

Expand Down

0 comments on commit 8a8f1b2

Please sign in to comment.