[flang-commits] [flang] 5e564d9 - [Flang][runtime] Fix compilation errors introduced with PR #96652 (#97442)

via flang-commits flang-commits at lists.llvm.org
Tue Jul 2 10:25:27 PDT 2024


Author: Michael Klemm
Date: 2024-07-02T19:25:23+02:00
New Revision: 5e564d97e3e99006e725b3ac514675a0157e9762

URL: https://github.com/llvm/llvm-project/commit/5e564d97e3e99006e725b3ac514675a0157e9762
DIFF: https://github.com/llvm/llvm-project/commit/5e564d97e3e99006e725b3ac514675a0157e9762.diff

LOG: [Flang][runtime] Fix compilation errors introduced with PR #96652 (#97442)

Added: 
    

Modified: 
    flang/runtime/time-intrinsic.cpp

Removed: 
    


################################################################################
diff  --git a/flang/runtime/time-intrinsic.cpp b/flang/runtime/time-intrinsic.cpp
index ac372b249fa4b..7352dafc9136e 100644
--- a/flang/runtime/time-intrinsic.cpp
+++ b/flang/runtime/time-intrinsic.cpp
@@ -126,7 +126,7 @@ static constexpr inline unsigned_count_t GetHUGE(int kind) {
 // Function converts a std::timespec_t into the desired count to
 // be returned by the timing functions in accordance with the requested
 // kind at the call site.
-count_t ConvertTimeSpecToCount(int kind, const std::timespec &tspec) {
+count_t ConvertTimeSpecToCount(int kind, const struct timespec &tspec) {
   const unsigned_count_t huge{GetHUGE(kind)};
   unsigned_count_t sec{static_cast<unsigned_count_t>(tspec.tv_sec)};
   unsigned_count_t nsec{static_cast<unsigned_count_t>(tspec.tv_nsec)};
@@ -142,9 +142,9 @@ count_t ConvertTimeSpecToCount(int kind, const std::timespec &tspec) {
 // This is the fallback implementation, which should work everywhere.
 template <typename Unused = void>
 count_t GetSystemClockCount(int kind, fallback_implementation) {
-  std::timespec tspec;
+  struct timespec tspec;
 
-  if (std::timespec_get(&tspec, TIME_UTC) < 0) {
+  if (timespec_get(&tspec, TIME_UTC) < 0) {
     // Return -HUGE(COUNT) to represent failure.
     return -static_cast<count_t>(GetHUGE(kind));
   }


        


More information about the flang-commits mailing list