]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Move time_seconds function to MiniTrace.cpp where it’s used
authorJoel Rosdahl <joel@rosdahl.net>
Fri, 31 Jul 2020 18:09:29 +0000 (20:09 +0200)
committerJoel Rosdahl <joel@rosdahl.net>
Fri, 31 Jul 2020 18:31:54 +0000 (20:31 +0200)
src/MiniTrace.cpp
src/legacy_util.cpp
src/legacy_util.hpp

index 07b6af079bae2cc55635480542830f24190c671b..6174b2ca3ccc8b1fc08ad89c4c2c3b638415d4cf 100644 (file)
 #  include "Util.hpp"
 #  include "legacy_util.hpp"
 
+#  ifdef HAVE_SYS_TIME_H
+#    include <sys/time.h>
+#  endif
+
 namespace {
 
 std::string
@@ -46,6 +50,18 @@ get_system_tmp_dir()
   return "/tmp";
 }
 
+double
+time_seconds()
+{
+#  ifdef HAVE_GETTIMEOFDAY
+  struct timeval tv;
+  gettimeofday(&tv, nullptr);
+  return (double)tv.tv_sec + (double)tv.tv_usec / 1000000.0;
+#  else
+  return (double)time(nullptr);
+#  endif
+}
+
 } // namespace
 
 MiniTrace::MiniTrace(const ArgsInfo& args_info)
index b432f9b9c1e2e07bca0a3895d9002d64e8edefdf..51d474a7ea73fcce25d21c2d6f6049ecb631e05c 100644 (file)
 #ifdef HAVE_SYS_TIME_H
 #  include <sys/time.h>
 #endif
-
-double
-time_seconds()
-{
-#ifdef HAVE_GETTIMEOFDAY
-  struct timeval tv;
-  gettimeofday(&tv, nullptr);
-  return (double)tv.tv_sec + (double)tv.tv_usec / 1000000.0;
-#else
-  return (double)time(NULL);
-#endif
-}
index 7f6a940b4824b7fe52483dd1c051fea4fc236f70..fd2dba40651c4b97aba64633f0e516b611f83d45 100644 (file)
@@ -21,5 +21,3 @@
 #include "system.hpp"
 
 #include <string>
-
-double time_seconds();