coop-deluxe / sm64coopdx

An official continuation of https://github.com/djoslin0/sm64ex-coop on sm64coopdx for the enhancements and progress it already has.
https://sm64coopdx.com
408 stars 73 forks source link

Fix windows compilation by undefining min and max when defined via minwindef.h (already in main) #378

Closed Multi-Volt closed 1 month ago

Multi-Volt commented 1 month ago

Hello,

For windows users the compilation of dev is currently broken since min and max are included (and subsequently redefined via minwindef.h). These lines were taken out in my previous PR and should be re-added. These are the issues I encountered when testing/compiling on windows:


src/engine/math_util.h:37:9: warning: "min" redefined
   37 | #define min(a, b) _Generic((a), \
      |         ^~~
C:/msys64/mingw64/include/minwindef.h:177:9: note: this is the location of the previous definition
  177 | #define min(a, b) (((a) < (b)) ? (a) : (b))
      |         ^~~
src/engine/math_util.h:42:9: warning: "max" redefined
   42 | #define max(a, b) _Generic((a), \
      |         ^~~
C:/msys64/mingw64/include/minwindef.h:173:9: note: this is the location of the previous definition
  173 | #define max(a, b) (((a) > (b)) ? (a) : (b))
      |         ^~~```