]> www.ginac.de Git - cln.git/commitdiff
[build] Don't try to find out the exact prototype of gettimeofday().
authorAlexey Sheplyakov <asheplyakov@yandex.ru>
Tue, 30 Aug 2011 20:28:37 +0000 (23:28 +0300)
committerAlexey Sheplyakov <asheplyakov@altlinux.org>
Sun, 20 Dec 2020 13:45:58 +0000 (17:45 +0400)
First of all, according to POSIX gettimeofday() has the following protype:

int gettimeofday(struct timeval *restrict tp, void restrict* tzp);

so GETTIMEOFDAY_DOTS is not really necessary.

Secondly, we always pass NULL as the second argument, so its type does not
really matter.

src/base/cl_base_config.h.in
src/base/random/cl_random_from.cc
src/timing/cl_t_config.h.in
src/timing/cl_t_current.cc

index a04f8599f89d78ab3a9ec535c8bf7e067a96dc4c..8512b7623d293908d048863c7206a8b270f927d7 100644 (file)
 /* CL_GETTIMEOFDAY */
 /* Define if you have the gettimeofday() function. */
 #undef HAVE_GETTIMEOFDAY
-/* Define if the declaration of gettimeofday() needs dots. */
-#undef GETTIMEOFDAY_DOTS
-/* Define as the type of `tzp' in gettimeofday() declaration. */
-#undef GETTIMEOFDAY_TZP_T
 
 
 #endif /* _CL_BASE_CONFIG_H */
index 53bc305f738b63913ed2c8d5a00c009cee5be229..6ab8d45b42eab59bb9a2b421ff0fca2926a88ff5 100644 (file)
 #include <unistd.h> // declares getpid()
 
 #if defined(HAVE_GETTIMEOFDAY)
-
 #include <sys/time.h>
-#ifdef GETTIMEOFDAY_DOTS
-  extern "C" int gettimeofday (struct timeval * tp, ...);
-#else
-  extern "C" int gettimeofday (struct timeval * tp, GETTIMEOFDAY_TZP_T tzp);
-#endif
 
 namespace cln {
 inline uint32 get_seed (void)
 {
        var struct timeval tv;
-       gettimeofday(&tv,0);
+       gettimeofday(&tv,NULL);
        return highlow32(tv.tv_sec,tv.tv_usec); // 16+16 zufällige Bits
 }
 }  // namespace cln
index aa4acecd7195a6362a04c21ab917329db94ba293..98b180b2b0d84ca9c8c44c7e0b1912d3d2c353dc 100644 (file)
 /* CL_GETTIMEOFDAY */
 /* Define if you have the gettimeofday() function. */
 #undef HAVE_GETTIMEOFDAY
-/* Define if the declaration of gettimeofday() needs dots. */
-#undef GETTIMEOFDAY_DOTS
-/* Define as the type of `tzp' in gettimeofday() declaration. */
-#undef GETTIMEOFDAY_TZP_T
 
 /* CL_RUSAGE */
 /* Define if you have <sys/resource.h>. */
index 6800e39f881b621e7c988e477cfd108e6ec6a742..fd0e197bb040f39e0c2e6c09bc0433d9532ce222 100644 (file)
 
 #if defined(HAVE_GETTIMEOFDAY)
   #include <sys/time.h>
-  #ifdef GETTIMEOFDAY_DOTS
-    extern "C" int gettimeofday (struct timeval * tp, ...);
-  #else
-    extern "C" int gettimeofday (struct timeval * tp, GETTIMEOFDAY_TZP_T tzp);
-  #endif
 #elif defined(_WIN32) && !defined(__CYGWIN__)
   /* <windows.h> included above. */
 #else