Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Handle different types for second parameter of gettimeofday.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Mon, 11 Jul 2022 07:57:07 +0000 (09:57 +0200)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Mon, 11 Jul 2022 11:48:47 +0000 (13:48 +0200)
src/sthread/sthread.c
src/sthread/sthread.h
src/sthread/sthread_impl.cpp

index 0de4be3..34d4230 100644 (file)
@@ -147,9 +147,13 @@ int pthread_mutex_destroy(pthread_mutex_t* mutex)
   return res;
 }
 
-int gettimeofday(struct timeval* tv, void* tz)
+#if !defined(__GLIBC__) || __GLIBC_PREREQ(2, 31)
+int gettimeofday(struct timeval* tv, XBT_ATTRIB_UNUSED void* tz)
+#else
+int gettimeofday(struct timeval* tv, XBT_ATTRIB_UNUSED struct timezone* tz)
+#endif
 {
-  return sthread_gettimeofday(tv, tz);
+  return sthread_gettimeofday(tv);
 }
 
 unsigned int sleep(unsigned int seconds)
index 1af8618..e13357b 100644 (file)
@@ -40,11 +40,11 @@ int sthread_mutex_trylock(sthread_mutex_t* mutex);
 int sthread_mutex_unlock(sthread_mutex_t* mutex);
 int sthread_mutex_destroy(sthread_mutex_t* mutex);
 
-int sthread_gettimeofday(struct timeval* tv, struct timezone* tz);
+int sthread_gettimeofday(struct timeval* tv);
 void sthread_sleep(double seconds);
 
 #if defined(__cplusplus)
 }
 #endif
 
-#endif
\ No newline at end of file
+#endif
index 243aa7b..768a0d5 100644 (file)
@@ -130,7 +130,7 @@ int sthread_mutex_destroy(sthread_mutex_t* mutex)
   return 0;
 }
 
-int sthread_gettimeofday(struct timeval* tv, struct timezone* tz)
+int sthread_gettimeofday(struct timeval* tv)
 {
   if (tv) {
     double now   = simgrid::s4u::Engine::get_clock();