[clang] [openmp] [OpenMP] Add support for Solaris/x86_64 (PR #70593)

Shilei Tian via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 8 15:06:24 PST 2023


================
@@ -70,6 +72,15 @@ struct kmp_sys_timer {
   struct timespec start;
 };
 
+#ifdef KMP_OS_SOLARIS
+// Convert timeval to timespec.
+#define TIMEVAL_TO_TIMESPEC(tv, ts)                                            \
----------------
shiltian wrote:

It looks like this macro is not guarded correct somewhere else such that the compiler complains on a non-Solaris system.
```
[19/128] Building CXX object runtime/src/CMakeFiles/omp.dir/z_Linux_util.cpp.o
/home/ac.shilei.tian/Documents/vscode/llvm-project/openmp/runtime/src/z_Linux_util.cpp:77:9: warning: 'TIMEVAL_TO_TIMESPEC' macro redefined [-Wmacro-redefined]
   77 | #define TIMEVAL_TO_TIMESPEC(tv, ts)                                            \
      |         ^
/usr/include/sys/time.h:38:10: note: previous definition is here
   38 | # define TIMEVAL_TO_TIMESPEC(tv, ts) {                                   \
      |          ^
```

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


More information about the cfe-commits mailing list