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:
		
							parent
							
								
									4b40f2c516
								
							
						
					
					
						commit
						f1622c195d
					
				
					 8 changed files with 33 additions and 19 deletions
				
			
		
							
								
								
									
										21
									
								
								ChangeLog
									
										
									
									
									
								
							
							
						
						
									
										21
									
								
								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 | ||||
|  |  | |||
|  | @ -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); | ||||
|  |  | |||
|  | @ -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 | ||||
| 
 | ||||
|  |  | |||
|  | @ -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 | ||||
|  |  | |||
|  | @ -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
									
										
									
									
									
								
							
							
						
						
									
										15
									
								
								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 | ||||
|  |  | |||
|  | @ -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); | ||||
|  |  | |||
|  | @ -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 */ | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 nobu
						nobu