oneapi-src / SYCLomatic

Other
222 stars 91 forks source link

[SYCLomatic] Guard std min/max from expanding into a min/max macro on Windows #2147

Closed the-slow-one closed 3 weeks ago

the-slow-one commented 1 month ago

icpx fails to compile the following code on Windows

#include <windows.h>
#include <dpct/dpct.hpp>
int main() { 
  return 0;
}

The compile error indicates the min/max marco expansion (defined in winmindef.h) in DPCT runtime headers.

This PR fixes the issue by preventing preprocessing of min/max using parentheses.