Skip to content

Commit

Permalink
[OpenMP] Change check for OS to check for defined for a macro (#75012)
Browse files Browse the repository at this point in the history
Check for the existence of the macro instead of checking for Solaris.
illumos has this macro in sys/time.h.

/export/home/brad/llvm-brad/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:424:9: note: previous definition is here
  424 | #define TIMEVAL_TO_TIMESPEC(tv, ts) { \
      |         ^
  • Loading branch information
brad0 committed Dec 11, 2023
1 parent 29bd78b commit 8b5af31
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion openmp/runtime/src/z_Linux_util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ struct kmp_sys_timer {
struct timespec start;
};

#if KMP_OS_SOLARIS
#ifndef TIMEVAL_TO_TIMESPEC
// Convert timeval to timespec.
#define TIMEVAL_TO_TIMESPEC(tv, ts) \
do { \
Expand Down

0 comments on commit 8b5af31

Please sign in to comment.