Skip to content

Commit

Permalink
add tag v1_8_5_159
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.ruby-lang.org/repos/ruby/tags/v1_8_5_159@16987 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
shyouhei committed Jun 7, 2008
2 parents cde8181 + b029201 commit 6f53b37
Show file tree
Hide file tree
Showing 6 changed files with 73 additions and 36 deletions.
14 changes: 14 additions & 0 deletions ChangeLog
Original file line number Original file line Diff line number Diff line change
@@ -1,3 +1,17 @@
Sun Jun 8 05:21:46 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>

* configure.in (RUBY_CHECK_VARTYPE): check if a variable is defined
and its type.

* configure.in (timezone, altzone): check for recent cygwin.

* missing/strftime.c (strftime): fix for timezone. [ruby-dev:32536]

* lib/mkmf.rb (try_var): should fail for functions.

* ext/readline/extconf.rb: should use have_func for functions instead
of have_var.

Sun Jun 8 05:09:29 2008 Yukihiro Matsumoto <matz@ruby-lang.org> Sun Jun 8 05:09:29 2008 Yukihiro Matsumoto <matz@ruby-lang.org>


* lib/uri/common.rb (URI::REGEXP::PATTERN): typo in REG_NAME * lib/uri/common.rb (URI::REGEXP::PATTERN): typo in REG_NAME
Expand Down
30 changes: 28 additions & 2 deletions configure.in
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -491,7 +491,8 @@ AC_CHECK_FUNCS(fmod killpg wait4 waitpid syscall chroot fsync getcwd eaccess\
lchown lchmod getpgrp setpgrp getpgid setpgid initgroups\ lchown lchmod getpgrp setpgrp getpgid setpgid initgroups\
getgroups setgroups getpriority getrlimit setrlimit sysconf\ getgroups setgroups getpriority getrlimit setrlimit sysconf\
group_member dlopen sigprocmask\ group_member dlopen sigprocmask\
sigaction _setjmp setsid telldir seekdir fchmod mktime timegm\ sigaction _setjmp setsid telldir seekdir fchmod\
mktime timegm gettimeofday\
cosh sinh tanh round setuid setgid setenv unsetenv) cosh sinh tanh round setuid setgid setenv unsetenv)
AC_ARG_ENABLE(setreuid, AC_ARG_ENABLE(setreuid,
[ --enable-setreuid use setreuid()/setregid() according to need even if obsolete.], [ --enable-setreuid use setreuid()/setregid() according to need even if obsolete.],
Expand All @@ -518,6 +519,31 @@ AC_CACHE_CHECK(for external int daylight, rb_cv_have_daylight,
if test "$rb_cv_have_daylight" = yes; then if test "$rb_cv_have_daylight" = yes; then
AC_DEFINE(HAVE_DAYLIGHT) AC_DEFINE(HAVE_DAYLIGHT)
fi fi
AC_DEFUN([RUBY_CHECK_VARTYPE], [dnl
AC_CACHE_CHECK([for external $1], rb_cv_var_$1,
[rb_cv_var_$1=no
AC_TRY_COMPILE([#define _XOPEN_SOURCE 1
$2
const volatile void *volatile t;],
[t = &(&$1)[0];],
[for t in $3; do
AC_TRY_COMPILE([#define _XOPEN_SOURCE 1
$2
extern $t $1;
const volatile void *volatile t;],
[t = &(&$1)[0];],
[rb_cv_var_$1=$t; break])
done])])
if test "[$rb_cv_var_]$1" != no; then
AC_DEFINE([HAVE_VAR_]m4_toupper($1))
AC_DEFINE_UNQUOTED([TYPEOF_VAR_]m4_toupper($1), $rb_cv_var_$1)
fi])
RUBY_CHECK_VARTYPE(timezone, [#include <time.h>], [long int])
RUBY_CHECK_VARTYPE(altzone, [#include <time.h>], [long int])
if test "$rb_cv_var_timezone" = no; then
AC_CHECK_FUNCS(timezone)
fi

AC_CACHE_CHECK(for negative time_t for gmtime(3), rb_cv_negative_time_t, AC_CACHE_CHECK(for negative time_t for gmtime(3), rb_cv_negative_time_t,
[AC_TRY_RUN([ [AC_TRY_RUN([
#include <time.h> #include <time.h>
Expand Down Expand Up @@ -1146,7 +1172,7 @@ case "$target_os" in
human*) human*)
AC_CHECK_LIB(signal, _harderr) AC_CHECK_LIB(signal, _harderr)
AC_CHECK_LIB(hmem, hmemset) AC_CHECK_LIB(hmem, hmemset)
AC_CHECK_FUNCS(select gettimeofday) AC_CHECK_FUNCS(select)
AC_CACHE_CHECK(whether PD libc _dtos18 fail to convert big number, AC_CACHE_CHECK(whether PD libc _dtos18 fail to convert big number,
rb_cv_missing__dtos18, rb_cv_missing__dtos18,
[AC_TRY_RUN( [AC_TRY_RUN(
Expand Down
5 changes: 3 additions & 2 deletions ext/readline/extconf.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ def have_readline_var(var)
end end
end end


have_readline_var("rl_filename_completion_function") have_func("rl_filename_completion_function")
have_func("rl_username_completion_function")
have_func("rl_completion_matches")
have_readline_var("rl_deprep_term_function") have_readline_var("rl_deprep_term_function")
have_readline_var("rl_completion_append_character") have_readline_var("rl_completion_append_character")
have_readline_var("rl_basic_word_break_characters") have_readline_var("rl_basic_word_break_characters")
Expand All @@ -57,7 +59,6 @@ def have_readline_var(var)
have_func("rl_clear_signals") have_func("rl_clear_signals")
have_func("rl_vi_editing_mode") have_func("rl_vi_editing_mode")
have_func("rl_emacs_editing_mode") have_func("rl_emacs_editing_mode")
have_func("rl_clear_signals")
have_func("replace_history_entry") have_func("replace_history_entry")
have_func("remove_history") have_func("remove_history")
create_makefile("readline") create_makefile("readline")
2 changes: 1 addition & 1 deletion lib/mkmf.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ def try_var(var, headers = nil, &b)
#{headers} #{headers}
/*top*/ /*top*/
int main() { return 0; } int main() { return 0; }
int t() { const volatile void *volatile p; p = (void *)&#{var}; return 0; } int t() { const volatile void *volatile p; p = &(&#{var})[0]; return 0; }
SRC SRC
end end


Expand Down
56 changes: 26 additions & 30 deletions missing/strftime.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -115,17 +115,22 @@ extern char *strchr();


#define range(low, item, hi) max(low, min(item, hi)) #define range(low, item, hi) max(low, min(item, hi))


#ifdef __CYGWIN__
#define DLL_IMPORT __declspec(dllimport)
#endif
#ifdef __WIN32__
#define DLL_IMPORT __declspec(dllimport)
#endif
#if !defined(OS2) && !defined(MSDOS) && defined(HAVE_TZNAME) #if !defined(OS2) && !defined(MSDOS) && defined(HAVE_TZNAME)
extern char *tzname[2]; extern DLL_IMPORT char *tzname[2];
extern int daylight; #ifdef HAVE_DAYLIGHT
#ifdef SOLARIS extern DLL_IMPORT int daylight;
extern long timezone, altzone; #endif
#else #ifdef HAVE_VAR_TIMEZONE
#ifdef __hpux extern DLL_IMPORT TYPEOF_VAR_TIMEZONE timezone;
extern long timezone;
#else
extern int timezone, altzone;
#endif #endif
#ifdef HAVE_VAR_ALTZONE
extern DLL_IMPORT TYPEOF_VAR_ALTZONE altzone;
#endif #endif
#endif #endif


Expand Down Expand Up @@ -189,16 +194,8 @@ strftime(char *s, size_t maxsize, const char *format, const struct tm *timeptr)
#endif /* POSIX_SEMANTICS */ #endif /* POSIX_SEMANTICS */
#ifndef HAVE_TM_ZONE #ifndef HAVE_TM_ZONE
#ifndef HAVE_TM_NAME #ifndef HAVE_TM_NAME
#ifndef HAVE_TZNAME
extern char *timezone();
struct timeval tv; struct timeval tv;
struct timezone zone; struct timezone zone;
#else
#ifdef __hpux
struct timeval tv;
struct timezone zone;
#endif
#endif /* HAVE_TZNAME */
#endif /* HAVE_TM_NAME */ #endif /* HAVE_TM_NAME */
#endif /* HAVE_TM_ZONE */ #endif /* HAVE_TM_ZONE */


Expand Down Expand Up @@ -422,21 +419,18 @@ strftime(char *s, size_t maxsize, const char *format, const struct tm *timeptr)
*/ */
off = timeptr->tm_gmtoff / 60; off = timeptr->tm_gmtoff / 60;
#else /* !HAVE_TM_ZONE */ #else /* !HAVE_TM_ZONE */
#if HAVE_TZNAME #ifdef HAVE_GETTIMEOFDAY
/*
* Systems with tzname[] probably have timezone as
* secs west of GMT. Convert to mins east of GMT.
*/
#ifdef __hpux
gettimeofday(&tv, &zone); gettimeofday(&tv, &zone);
off = -zone.tz_minuteswest; off = -zone.tz_minuteswest;
#else #else
#if HAVE_VAR_TIMEZONE
#if HAVE_VAR_ALTZONE
off = -(daylight ? timezone : altzone) / 60; off = -(daylight ? timezone : altzone) / 60;
#else
off = -timezone / 60;
#endif
#endif
#endif #endif
#else /* !HAVE_TZNAME */
gettimeofday(&tv, &zone);
off = -zone.tz_minuteswest;
#endif /* !HAVE_TZNAME */
#endif /* !HAVE_TM_ZONE */ #endif /* !HAVE_TM_ZONE */
#endif /* !HAVE_TM_NAME */ #endif /* !HAVE_TM_NAME */
if (off < 0) { if (off < 0) {
Expand All @@ -460,13 +454,15 @@ strftime(char *s, size_t maxsize, const char *format, const struct tm *timeptr)
#ifdef HAVE_TM_NAME #ifdef HAVE_TM_NAME
strcpy(tbuf, timeptr->tm_name); strcpy(tbuf, timeptr->tm_name);
#else #else
#ifdef HAVE_TIMEZONE
gettimeofday(& tv, & zone); gettimeofday(& tv, & zone);
#ifdef __CYGWIN__ #ifdef TIMEZONE_VOID
strcpy(tbuf, timezone()); strcpy(tbuf, timezone());
#else #else
strcpy(tbuf, timezone(zone.tz_minuteswest, strcpy(tbuf, timezone(zone.tz_minuteswest,
timeptr->tm_isdst > 0)); timeptr->tm_isdst > 0));
#endif #endif /* TIMEZONE_VOID */
#endif /* HAVE_TIMEZONE */
#endif /* HAVE_TM_NAME */ #endif /* HAVE_TM_NAME */
#endif /* HAVE_TM_ZONE */ #endif /* HAVE_TM_ZONE */
#endif /* HAVE_TZNAME */ #endif /* HAVE_TZNAME */
Expand Down Expand Up @@ -645,7 +641,7 @@ iso8601wknum(const struct tm *timeptr)
* main body of the standard. Thus it requires week 53. * main body of the standard. Thus it requires week 53.
*/ */


int weeknum, jan1day, diff; int weeknum, jan1day;


/* get week number, Monday as first day of the week */ /* get week number, Monday as first day of the week */
weeknum = weeknumber(timeptr, 1); weeknum = weeknumber(timeptr, 1);
Expand Down
2 changes: 1 addition & 1 deletion version.h
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#define RUBY_RELEASE_DATE "2008-06-08" #define RUBY_RELEASE_DATE "2008-06-08"
#define RUBY_VERSION_CODE 185 #define RUBY_VERSION_CODE 185
#define RUBY_RELEASE_CODE 20080608 #define RUBY_RELEASE_CODE 20080608
#define RUBY_PATCHLEVEL 158 #define RUBY_PATCHLEVEL 159


#define RUBY_VERSION_MAJOR 1 #define RUBY_VERSION_MAJOR 1
#define RUBY_VERSION_MINOR 8 #define RUBY_VERSION_MINOR 8
Expand Down

0 comments on commit 6f53b37

Please sign in to comment.