#ifndef _XOPEN_SOURCE
# define _XOPEN_SOURCE 500
#endif
+ # ifndef _BSD_SOURCE
+ # define _BSD_SOURCE
+ # endif
+ # ifndef _DEFAULT_SOURCE
+ # define _DEFAULT_SOURCE
+ # endif
#include <time.h>
]],
[[
# ifndef _XOPEN_SOURCE
# define _XOPEN_SOURCE 500
# endif
+# ifndef _BSD_SOURCE
+# define _BSD_SOURCE
+# endif
+# ifndef _DEFAULT_SOURCE
+# define _DEFAULT_SOURCE
+# endif
#endif
#include <time.h>
]]],
)
)
-if test "x$c_cv_have_timegm" != "xyes"
-then
- AC_CACHE_CHECK([for timegm with _BSD_SOURCE],
- [c_cv_have_timegm_bsd],
- AC_LINK_IFELSE(
- [AC_LANG_PROGRAM(
-[[[
-#if STRPTIME_NEEDS_STANDARDS
-# ifndef _ISOC99_SOURCE
-# define _ISOC99_SOURCE 1
-# endif
-# ifndef _POSIX_C_SOURCE
-# define _POSIX_C_SOURCE 200112L
-# endif
-# ifndef _XOPEN_SOURCE
-# define _XOPEN_SOURCE 500
-# endif
-#endif
-#ifndef _BSD_SOURCE
-# define _BSD_SOURCE 1
-#endif
-#include <time.h>
-]]],
-[[[
- time_t t = timegm(&(struct tm){0});
- if (t == ((time_t) -1)) {
- return 1;
- }
-]]]
- )],
- [c_cv_have_timegm_bsd="yes"
- c_cv_have_timegm="yes"],
- [c_cv_have_timegm_bsd="no"]
- )
- )
-fi
-
if test "x$c_cv_have_timegm" = "xyes"
then
AC_DEFINE(HAVE_TIMEGM, 1, [Define if the timegm(3) function is available.])
- if test "x$c_cv_have_timegm_bsd" = "xyes"
- then
- AC_DEFINE(TIMEGM_NEEDS_BSD, 1, [Set to true if timegm is only exported in BSD mode.])
- fi
fi
CFLAGS="$SAVE_CFLAGS"
#ifndef _XOPEN_SOURCE
#define _XOPEN_SOURCE 500
#endif
-#endif /* STRPTIME_NEEDS_STANDARDS */
-
-#if TIMEGM_NEEDS_BSD
#ifndef _BSD_SOURCE
-#define _BSD_SOURCE 1
+#define _BSD_SOURCE
#endif
-#endif /* TIMEGM_NEEDS_BSD */
+#ifndef _DEFAULT_SOURCE
+#define _DEFAULT_SOURCE
+#endif
+#endif /* STRPTIME_NEEDS_STANDARDS */
#include "collectd.h"