unix-time 0.4.5 → 0.4.6
raw patch · 9 files changed
+144/−16 lines, 9 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- Data/UnixTime/Sys.hsc +1/−3
- cbits/config.h.in +28/−10
- cbits/strftime.c +4/−1
- cbits/strptime.c +4/−1
- cbits/win_patch.c +2/−0
- cbits/win_patch.h +16/−0
- configure +71/−0
- configure.ac +17/−0
- unix-time.cabal +1/−1
Data/UnixTime/Sys.hsc view
@@ -26,6 +26,4 @@ getUnixTime :: IO UnixTime getUnixTime = allocaBytes (#const sizeof(struct timeval)) $ \ p_timeval -> do throwErrnoIfMinus1_ "getClockTime" $ c_gettimeofday p_timeval nullPtr- sec <- (#peek struct timeval,tv_sec) p_timeval- usec <- (#peek struct timeval,tv_usec) p_timeval- return $ UnixTime sec usec+ peek (castPtr p_timeval)
cbits/config.h.in view
@@ -21,6 +21,12 @@ /* Define to 1 if you have the `strptime_l' function. */ #undef HAVE_STRPTIME_L +/* Define to 1 if you have the `strtoll_l' function. */+#undef HAVE_STRTOLL_L++/* Define to 1 if you have the `strtol_l' function. */+#undef HAVE_STRTOL_L+ /* Define to 1 if you have the <sys/stat.h> header file. */ #undef HAVE_SYS_STAT_H @@ -30,26 +36,38 @@ /* Define to 1 if you have the `timegm' function. */ #undef HAVE_TIMEGM -/* Define to 1 if you have the `_mkgmtime' function. */-#undef HAVE__MKGMTIME+/* Define to 1 if you have the <unistd.h> header file. */+#undef HAVE_UNISTD_H +/* Define to 1 if you have the <xlocale.h> header file. */+#undef HAVE_XLOCALE_H++/* Define to 1 if you have the `_create_locale' function. */+#undef HAVE__CREATE_LOCALE+ /* Define to 1 if you have the `_get_current_locale' function. */ #undef HAVE__GET_CURRENT_LOCALE -/* Define to 1 if you have the `strtol_l' function. */-#undef HAVE_STRTOL_L+/* Define to 1 if you have the `_isblank_l' function. */+#undef HAVE__ISBLANK_L -/* Define to 1 if you have the `strtoll_l' function. */-#undef HAVE_STRTOLL_L+/* Define to 1 if you have the `_isdigit_l' function. */+#undef HAVE__ISDIGIT_L -/* Define to 1 if you have the <unistd.h> header file. */-#undef HAVE_UNISTD_H+/* Define to 1 if you have the `_isspace_l' function. */+#undef HAVE__ISSPACE_L -/* Define to 1 if you have the <xlocale.h> header file. */-#undef HAVE_XLOCALE_H+/* Define to 1 if you have the `_isupper_l' function. */+#undef HAVE__ISUPPER_L +/* Define to 1 if you have the `_mkgmtime' function. */+#undef HAVE__MKGMTIME+ /* "Is Linux" */ #undef IS_LINUX++/* "Is Windows NT 6.1" */+#undef IS_NT61 /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT
cbits/strftime.c view
@@ -112,8 +112,11 @@ { #if HAVE__GET_CURRENT_LOCALE return _patch_strftime_l(s, maxsize, format, t, _get_current_locale());-#else+#elif HAVE__CREATE_LOCALE && !IS_NT61 return _patch_strftime_l(s, maxsize, format, t, _create_locale(LC_TIME, "C"));+#else+ _locale_t locale;+ return _patch_strftime_l(s, maxsize, format, t, locale); #endif }
cbits/strptime.c view
@@ -712,7 +712,10 @@ { #if HAVE__GET_CURRENT_LOCALE return strptime_l(buf, fmt, tm, _get_current_locale());-#else+#elif HAVE__CREATE_LOCALE && !IS_NT61 return strptime_l(buf, fmt, tm, _create_locale(LC_TIME, "C"));+#else+ _locale_t locale;+ return strptime_l(buf, fmt, tm, locale); #endif }
cbits/win_patch.c view
@@ -12,10 +12,12 @@ } #endif +#if !HAVE__ISBLANK_L inline int isblank_l( int c, _locale_t _loc) { return ( c == ' ' || c == '\t' ); }+#endif inline int strncasecmp_l(const char *s1, const char *s2, int len, _locale_t _loc) { return strncasecmp(s1, s2, len);
cbits/win_patch.h view
@@ -81,9 +81,23 @@ 1 + TYPE_SIGNED(type)) #endif /* !defined INT_STRLEN_MAXIMUM */ +#if HAVE__ISSPACE_L #define isspace_l _isspace_l+#else+#define isspace_l(ch, locale) isspace(ch)+#endif++#if HAVE__ISUPPER_L #define isupper_l _isupper_l+#else+#define isupper_l(ch, locale) isupper(ch)+#endif++#if HAVE__ISDIGIT_L #define isdigit_l _isdigit_l+#else+#define isdigit_l(ch, locale) isdigit(ch)+#endif #if !HAVE_STRTOL_L long strtol_l(const char *nptr, char **endptr, int base, _locale_t locale);@@ -102,7 +116,9 @@ #define isleap_sum(a, b) isleap((a) % 400 + (b) % 400) #endif /* !defined isleap_sum */ +#if !HAVE__ISBLANK_L int isblank_l( int c, _locale_t _loc);+#endif int strncasecmp_l(const char *s1, const char *s2, int len, _locale_t _loc);
configure view
@@ -3326,6 +3326,17 @@ fi done +for ac_func in _create_locale+do :+ ac_fn_c_check_func "$LINENO" "_create_locale" "ac_cv_func__create_locale"+if test "x$ac_cv_func__create_locale" = xyes; then :+ cat >>confdefs.h <<_ACEOF+#define HAVE__CREATE_LOCALE 1+_ACEOF++fi+done+ for ac_func in strtol_l do : ac_fn_c_check_func "$LINENO" "strtol_l" "ac_cv_func_strtol_l"@@ -3348,7 +3359,51 @@ fi done +for ac_func in _isspace_l+do :+ ac_fn_c_check_func "$LINENO" "_isspace_l" "ac_cv_func__isspace_l"+if test "x$ac_cv_func__isspace_l" = xyes; then :+ cat >>confdefs.h <<_ACEOF+#define HAVE__ISSPACE_L 1+_ACEOF +fi+done++for ac_func in _isupper_l+do :+ ac_fn_c_check_func "$LINENO" "_isupper_l" "ac_cv_func__isupper_l"+if test "x$ac_cv_func__isupper_l" = xyes; then :+ cat >>confdefs.h <<_ACEOF+#define HAVE__ISUPPER_L 1+_ACEOF++fi+done++for ac_func in _isdigit_l+do :+ ac_fn_c_check_func "$LINENO" "_isdigit_l" "ac_cv_func__isdigit_l"+if test "x$ac_cv_func__isdigit_l" = xyes; then :+ cat >>confdefs.h <<_ACEOF+#define HAVE__ISDIGIT_L 1+_ACEOF++fi+done++for ac_func in _isblank_l+do :+ ac_fn_c_check_func "$LINENO" "_isblank_l" "ac_cv_func__isblank_l"+if test "x$ac_cv_func__isblank_l" = xyes; then :+ cat >>confdefs.h <<_ACEOF+#define HAVE__ISBLANK_L 1+_ACEOF++fi+done++ host=`uname -a` case $host in Linux*)@@ -3363,6 +3418,22 @@ cat >>confdefs.h <<_ACEOF #define IS_LINUX $LINUX _ACEOF+++case $host in+ MINGW??_NT-6.1*)+ NT61=1+ ;;+ *)+ NT61=0+ ;;+esac+++cat >>confdefs.h <<_ACEOF+#define IS_NT61 $NT61+_ACEOF+ cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure
configure.ac view
@@ -10,8 +10,13 @@ AC_CHECK_FUNCS(timegm) AC_CHECK_FUNCS(_mkgmtime) AC_CHECK_FUNCS(_get_current_locale)+AC_CHECK_FUNCS(_create_locale) AC_CHECK_FUNCS(strtol_l) AC_CHECK_FUNCS(strtoll_l)+AC_CHECK_FUNCS(_isspace_l)+AC_CHECK_FUNCS(_isupper_l)+AC_CHECK_FUNCS(_isdigit_l)+AC_CHECK_FUNCS(_isblank_l) host=`uname -a` case $host in@@ -24,4 +29,16 @@ esac AC_DEFINE_UNQUOTED(IS_LINUX,$LINUX,"Is Linux")++case $host in+ MINGW??_NT-6.1*)+ NT61=1+ ;;+ *)+ NT61=0+ ;;+esac++AC_DEFINE_UNQUOTED(IS_NT61,$NT61,"Is Windows NT 6.1")+ AC_OUTPUT
unix-time.cabal view
@@ -1,5 +1,5 @@ Name: unix-time-Version: 0.4.5+Version: 0.4.6 Author: Kazu Yamamoto <kazu@iij.ad.jp> Maintainer: Kazu Yamamoto <kazu@iij.ad.jp> License: BSD3