[clang] [clang] Fix name conflict with `sys/mac.h` on AIX (PR #88644)

Artem Belevich via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 15 11:53:59 PDT 2024


================
@@ -50,6 +50,10 @@ const char *CudaVersionToString(CudaVersion V);
 // Input is "Major.Minor"
 CudaVersion CudaStringToVersion(const llvm::Twine &S);
 
+// We have a name conflict with sys/mac.h on AIX
+#ifdef SM_32
+#undef SM_32
+#endif
----------------
Artem-B wrote:

> We could always just make all of these lower case instead?

That would be odd. LLVM style wants them to be CamelCased.
This enum is rarely used, so renaming them to something more CUDA/NVPTXspecific would be best, IMO.
E.g `NVSM_32` 

Or we could rename only `SM_32`. The constant is rather inconsequential and is used in a few places only. Renaming it to `_SM_32` with a comment that AIX headers have `SM_32` defined.





https://github.com/llvm/llvm-project/pull/88644


More information about the cfe-commits mailing list