[Openmp-commits] [openmp] 8b5af31 - [OpenMP] Change check for OS to check for defined for a macro (#75012)

via Openmp-commits openmp-commits at lists.llvm.org
Mon Dec 11 06:54:29 PST 2023


Author: Brad Smith
Date: 2023-12-11T09:54:24-05:00
New Revision: 8b5af3139c18516433bc77d65dea59df50e052e9

URL: https://github.com/llvm/llvm-project/commit/8b5af3139c18516433bc77d65dea59df50e052e9
DIFF: https://github.com/llvm/llvm-project/commit/8b5af3139c18516433bc77d65dea59df50e052e9.diff

LOG: [OpenMP] Change check for OS to check for defined for a macro (#75012)

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) { \
      |         ^

Added: 
    

Modified: 
    openmp/runtime/src/z_Linux_util.cpp

Removed: 
    


################################################################################
diff  --git a/openmp/runtime/src/z_Linux_util.cpp b/openmp/runtime/src/z_Linux_util.cpp
index 72da0f79865dfb..fdce932fd6d6bd 100644
--- a/openmp/runtime/src/z_Linux_util.cpp
+++ b/openmp/runtime/src/z_Linux_util.cpp
@@ -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 {                                                                         \


        


More information about the Openmp-commits mailing list