summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-07-22 05:33:54 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-07-22 05:33:54 +0000
commitf1622c195da92aaaa0200d3afcf44f58c0cf29d9 (patch)
tree02f34d7e3a591186505dfe5d8ce2c89c878ce93a
parent4b40f2c51607e5a918699952605bbcfc5bff9f99 (diff)
* 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
-rw-r--r--ChangeLog21
-rw-r--r--ext/Win32API/Win32API.c2
-rw-r--r--ext/socket/getnameinfo.c5
-rw-r--r--ext/tk/tcltklib.c4
-rw-r--r--ext/win32ole/win32ole.c2
-rw-r--r--file.c15
-rw-r--r--include/ruby/intern.h1
-rw-r--r--missing/strftime.c2
8 files changed, 33 insertions, 19 deletions
diff --git a/ChangeLog b/ChangeLog
index 7c20feb..c7f8808 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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
diff --git a/ext/Win32API/Win32API.c b/ext/Win32API/Win32API.c
index 9a2de01..766058d 100644
--- a/ext/Win32API/Win32API.c
+++ b/ext/Win32API/Win32API.c
@@ -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);
diff --git a/ext/socket/getnameinfo.c b/ext/socket/getnameinfo.c
index dcfdc6b..6214359 100644
--- a/ext/socket/getnameinfo.c
+++ b/ext/socket/getnameinfo.c
@@ -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
diff --git a/ext/tk/tcltklib.c b/ext/tk/tcltklib.c
index 4f779c7..d057abb 100644
--- a/ext/tk/tcltklib.c
+++ b/ext/tk/tcltklib.c
@@ -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
diff --git a/ext/win32ole/win32ole.c b/ext/win32ole/win32ole.c
index 5b31898..42336e7 100644
--- a/ext/win32ole/win32ole.c
+++ b/ext/win32ole/win32ole.c
@@ -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;
}
diff --git a/file.c b/file.c
index ed682a0..ff0c324 100644
--- a/file.c
+++ b/file.c
@@ -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
diff --git a/include/ruby/intern.h b/include/ruby/intern.h
index 3013370..b514957 100644
--- a/include/ruby/intern.h
+++ b/include/ruby/intern.h
@@ -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);
diff --git a/missing/strftime.c b/missing/strftime.c
index ba67852..d9712f4 100644
--- a/missing/strftime.c
+++ b/missing/strftime.c
@@ -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 */