From: Alexey Sheplyakov Date: Tue, 30 Aug 2011 20:28:37 +0000 (+0300) Subject: [build] Don't try to find out the exact prototype of gettimeofday(). X-Git-Tag: cln_1-3-7~35 X-Git-Url: https://www.ginac.de/CLN/cln.git//cln.git?a=commitdiff_plain;h=9bd135fc674d979989d0c9cb467cec5d8725a4de;p=cln.git [build] Don't try to find out the exact prototype of gettimeofday(). 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. --- diff --git a/src/base/cl_base_config.h.in b/src/base/cl_base_config.h.in index a04f859..8512b76 100644 --- a/src/base/cl_base_config.h.in +++ b/src/base/cl_base_config.h.in @@ -11,10 +11,6 @@ /* 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 */ diff --git a/src/base/random/cl_random_from.cc b/src/base/random/cl_random_from.cc index 53bc305..6ab8d45 100644 --- a/src/base/random/cl_random_from.cc +++ b/src/base/random/cl_random_from.cc @@ -24,19 +24,13 @@ #include // declares getpid() #if defined(HAVE_GETTIMEOFDAY) - #include -#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 diff --git a/src/timing/cl_t_config.h.in b/src/timing/cl_t_config.h.in index aa4acec..98b180b 100644 --- a/src/timing/cl_t_config.h.in +++ b/src/timing/cl_t_config.h.in @@ -11,10 +11,6 @@ /* 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 . */ diff --git a/src/timing/cl_t_current.cc b/src/timing/cl_t_current.cc index 6800e39..fd0e197 100644 --- a/src/timing/cl_t_current.cc +++ b/src/timing/cl_t_current.cc @@ -18,11 +18,6 @@ #if defined(HAVE_GETTIMEOFDAY) #include - #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__) /* included above. */ #else