1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* file.c (rb_file_s_rename): deleted code to get rid of a bug of

old Cygwin.

* file.c (rb_file_truncate): added prototype of GetLastError()
  on cygwin.  [ruby-dev:31239]

* include/ruby/intern.h (is_ruby_native_thread): prototype.

* missing/strftime.c (strftime): fix printf format and actual
  arguments.

* ext/Win32API/Win32API.c (Win32API_initialize): ditto.

* ext/tk/tcltklib.c (ip_finalize): ditto.

* ext/win32ole/win32ole.c (lcid_installed): ditto.

* ext/socket/getnameinfo.c: include stdio.h always.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12836 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2007-07-22 05:33:54 +00:00
parent 4b40f2c516
commit f1622c195d
8 changed files with 33 additions and 19 deletions

View file

@ -1,3 +1,24 @@
Sun Jul 22 14:33:46 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* file.c (rb_file_s_rename): deleted code to get rid of a bug of
old Cygwin.
* file.c (rb_file_truncate): added prototype of GetLastError()
on cygwin. [ruby-dev:31239]
* include/ruby/intern.h (is_ruby_native_thread): prototype.
* missing/strftime.c (strftime): fix printf format and actual
arguments.
* ext/Win32API/Win32API.c (Win32API_initialize): ditto.
* ext/tk/tcltklib.c (ip_finalize): ditto.
* ext/win32ole/win32ole.c (lcid_installed): ditto.
* ext/socket/getnameinfo.c: include stdio.h always.
Sat Jul 21 21:39:12 2007 Tadayoshi Funaba <tadf@dotrb.org>
* lib/date.rb, lib/date/format.rb (Date._parse): now can take some

View file

@ -108,7 +108,7 @@ Win32API_initialize(self, dllname, proc, import, export)
}
if (16 < RARRAY_LEN(a_import)) {
rb_raise(rb_eRuntimeError, "too many parameters: %d\n", RARRAY_LEN(a_import));
rb_raise(rb_eRuntimeError, "too many parameters: %ld\n", RARRAY_LEN(a_import));
}
rb_iv_set(self, "__import__", a_import);

View file

@ -35,6 +35,7 @@
*/
#include "ruby/config.h"
#include <stdio.h>
#include <sys/types.h>
#ifndef _WIN32
#if defined(__BEOS__)
@ -51,15 +52,11 @@
#endif
#include <netdb.h>
#if defined(HAVE_RESOLV_H)
#ifdef _SX
#include <stdio.h>
#endif
#include <resolv.h>
#endif
#endif
#ifdef _WIN32
#include <winsock2.h>
#include <stdio.h>
#define snprintf _snprintf
#endif

View file

@ -4408,13 +4408,13 @@ ip_finalize(ip)
}
if (Tcl_InterpDeleted(ip)) {
DUMP2("ip(%lx) is already deleted", ip);
DUMP2("ip(%p) is already deleted", ip);
return;
}
#if TCL_NAMESPACE_DEBUG
if (ip_null_namespace(ip)) {
DUMP2("ip(%lx) has null namespace", ip);
DUMP2("ip(%p) has null namespace", ip);
return;
}
#endif

View file

@ -2641,7 +2641,7 @@ static BOOL
lcid_installed(LCID lcid)
{
g_lcid_installed = FALSE;
snprintf(g_lcid_to_check, sizeof(g_lcid_to_check), "%08x", lcid);
snprintf(g_lcid_to_check, sizeof(g_lcid_to_check), "%08lx", lcid);
EnumSystemLocales(installed_lcid_proc, LCID_INSTALLED);
return g_lcid_installed;
}

15
file.c
View file

@ -2214,18 +2214,12 @@ rb_file_s_rename(VALUE klass, VALUE from, VALUE to)
errno = 0;
#endif
if (rename(src, dst) < 0) {
#if defined __CYGWIN__
extern unsigned long __attribute__((stdcall)) GetLastError(void);
if (errno == 0) { /* This is a bug of old Cygwin */
/* incorrect as cygwin errno, but the last resort */
errno = GetLastError();
}
#elif defined DOSISH && !defined _WIN32
if (errno == EEXIST
#if defined DOSISH && !defined _WIN32
switch (errno) {
case EEXIST:
#if defined (__EMX__)
|| errno == EACCES
case EACCES:
#endif
) {
if (chmod(dst, 0666) == 0 &&
unlink(dst) == 0 &&
rename(src, dst) == 0)
@ -3088,6 +3082,7 @@ rb_file_truncate(VALUE obj, VALUE len)
#ifdef __CYGWIN__
#include <winerror.h>
extern unsigned long __attribute__((stdcall)) GetLastError(void);
#endif
static VALUE

View file

@ -280,6 +280,7 @@ VALUE rb_thread_local_aref(VALUE, ID);
VALUE rb_thread_local_aset(VALUE, ID, VALUE);
void rb_thread_atfork(void);
VALUE rb_exec_recursive(VALUE(*)(VALUE, VALUE, int),VALUE,VALUE);
VALUE is_ruby_native_thread(void);
/* file.c */
VALUE rb_file_s_expand_path(int, VALUE *);
VALUE rb_file_expand_path(VALUE, VALUE);

View file

@ -445,7 +445,7 @@ strftime(char *s, size_t maxsize, const char *format, const struct tm *timeptr)
} else {
tbuf[0] = '+';
}
sprintf(tbuf+1, "%02d%02d", off/60, off%60);
sprintf(tbuf+1, "%02u%02u", (unsigned)off/60, (unsigned)off%60);
break;
#endif /* MAILHEADER_EXT */