From: "U.Nakamura" Date: 2002-12-20T23:29:38+09:00 Subject: [ruby-dev:19149] Re: [ruby-cvs] ruby: * file.c (utimbuf): need to define for VC++. こんにちは、なかむら(う)です。 In message "[ruby-dev:19133] Re: [ruby-cvs] ruby: * file.c (utimbuf): need to define for VC++." on Dec.20,2002 08:25:53, wrote: > 今晩あたり、winceな環境を用意して、そっちも対応したらcommit > します。 winceなコンパイル環境も用意して、コンパイルを通しはしたんで すが、いまいち納得できないので、再度パッチを出します。 検証できる方、お願いします... Index: file.c =================================================================== RCS file: /home/cvs/ruby/file.c,v retrieving revision 1.121 diff -u -1 -p -r1.121 file.c --- file.c 2002/12/20 08:33:12 1.121 +++ file.c 2002/12/20 14:27:03 @@ -1203,5 +1203,2 @@ struct utimbuf { #endif -#if defined(_WIN32) && !defined(_WIN32_WCE)&& (defined(_MSC_VER) || defined(__MINGW__)) -# define utimbuf _utimbuf -#endif Index: win32/Makefile.sub =================================================================== RCS file: /home/cvs/ruby/win32/Makefile.sub,v retrieving revision 1.33 diff -u -1 -p -r1.33 Makefile.sub --- win32/Makefile.sub 2002/12/15 03:18:08 1.33 +++ win32/Makefile.sub 2002/12/20 14:27:03 @@ -94,3 +94,3 @@ EXTLIBS = !endif -LIBS = user32.lib advapi32.lib wsock32.lib $(EXTLIBS) +LIBS = oldnames.lib user32.lib advapi32.lib wsock32.lib $(EXTLIBS) MISSING = acosh.obj crypt.obj win32.obj isinf.obj isnan.obj @@ -606,3 +606,3 @@ parse.obj: {$(srcdir)}parse.c {$(srcdir) {$(srcdir)}env.h {$(srcdir)}node.h {$(srcdir)}st.h {$(srcdir)}regex.h \ - {$(srcdir)}util.h {$(srcdir)}lex.c + {$(srcdir)}util.h {$(srcdir)}lex.c {$(srcdir)}/win32/win32.h prec.obj: {$(srcdir)}prec.c {$(srcdir)}ruby.h config.h \ Index: win32/win32.c =================================================================== RCS file: /home/cvs/ruby/win32/win32.c,v retrieving revision 1.75 diff -u -1 -p -r1.75 win32.c --- win32/win32.c 2002/12/02 07:57:17 1.75 +++ win32/win32.c 2002/12/20 14:27:03 @@ -2324,8 +2324,4 @@ rb_w32_getcwd(buffer, size) -#ifdef __BORLANDC__ #undef getcwd if (getcwd(buffer, size) == NULL) { -#else - if (_getcwd(buffer, size) == NULL) { -#endif return NULL; Index: win32/win32.h =================================================================== RCS file: /home/cvs/ruby/win32/win32.h,v retrieving revision 1.32 diff -u -1 -p -r1.32 win32.h --- win32/win32.h 2002/12/15 03:18:08 1.32 +++ win32/win32.h 2002/12/20 14:27:03 @@ -100,37 +100,5 @@ extern "C++" { -#ifndef __BORLANDC__ - -#define access _access -#define chmod _chmod -#define chsize _chsize -#define dup _dup -#define dup2 _dup2 -#define isatty _isatty -#define open _open -#define setmode _setmode -#define execl _execl -#define execle _execle -#define execlp _execlp -#define execlpe _execlpe -#define execv _execv -#define execve _execve -#define execvp _execvp -#define execvpe _execvpe -#define lseek _lseek -#define spawnl _spawnl -#define spawnle _spawnle -#define spawnlp _spawnlp -#define spawnlpe _spawnlpe -#define spawnv _spawnv -#define spawnve _spawnve -#define spawnvp _spawnvp -#define spawnvpe _spawnvpe -#if _MSC_VER < 800 -#define fileno _fileno -#endif -#define strcasecmp _stricmp -#define strncasecmp _strnicmp -#else #define strcasecmp stricmp #define strncasecmp strnicmp +#ifdef __BORLANDC__ #define _open _sopen @@ -140,2 +108,5 @@ extern "C++" { #define fclose rb_w32_fclose +#define getpid rb_w32_getpid +#define sleep(x) rb_w32_sleep((x)*1000) +#ifdef __BORLANDC__ #define creat _creat @@ -152,5 +123,4 @@ extern "C++" { #define write _write -#define getpid rb_w32_getpid -#define sleep(x) rb_w32_sleep((x)*1000) #define utime _utime +#endif #define vsnprintf _vsnprintf Index: wince/direct.c =================================================================== RCS file: /home/cvs/ruby/wince/direct.c,v retrieving revision 1.1 diff -u -1 -p -r1.1 direct.c --- wince/direct.c 2002/12/02 07:57:17 1.1 +++ wince/direct.c 2002/12/20 14:27:03 @@ -13,3 +13,3 @@ static char _currentdir[MAX_PATH+1]; -char *_getcwd(char* buffer, int maxlen) +char *getcwd(char* buffer, int maxlen) { Index: wince/direct.h =================================================================== RCS file: /home/cvs/ruby/wince/direct.h,v retrieving revision 1.1 diff -u -1 -p -r1.1 direct.h --- wince/direct.h 2002/12/02 07:57:17 1.1 +++ wince/direct.h 2002/12/20 14:27:03 @@ -8,3 +8,3 @@ extern "C" { -char *_getcwd(char* buffer, int maxlen); +char *getcwd(char* buffer, int maxlen); int _chdir(const char * dirname); @@ -17,3 +17,2 @@ int _mkdir(const char * dir); -#define getcwd _getcwd #define chdir _chdir Index: wince/io.h =================================================================== RCS file: /home/cvs/ruby/wince/io.h,v retrieving revision 1.2 diff -u -1 -p -r1.2 io.h --- wince/io.h 2002/12/14 05:27:35 1.2 +++ wince/io.h 2002/12/20 14:27:03 @@ -51,2 +51,3 @@ int _findclose( long handle ); +#define chmod _chmod #define chsize _chsize @@ -63,2 +64,4 @@ int _findclose( long handle ); #define pipe _pipe +#define setmode _setmode +#define lseek _lseek Index: wince/string.c =================================================================== RCS file: /home/cvs/ruby/wince/string.c,v retrieving revision 1.1 diff -u -1 -p -r1.1 string.c --- wince/string.c 2002/12/02 07:57:17 1.1 +++ wince/string.c 2002/12/20 14:27:03 @@ -25,4 +25,4 @@ char* strerror(int errno) -/* _strnicmp already exists in stdlib.h? */ -int _strnicmp( const char *s1, const char *s2, size_t count ) +/* strnicmp already exists in stdlib.h? */ +int strnicmp( const char *s1, const char *s2, size_t count ) { @@ -42,4 +42,4 @@ int _strnicmp( const char *s1, const cha -#if _WIN32_WCE < 300 -#include "..\missing\strtoul.c" +#if _WIN32_WCE < 300 +#include "..\missing\strtoul.c" @@ -55,3 +55,3 @@ char *strrchr( const char *p, int c ) -int _stricmp( const char *s1, const char *s2 ) +int stricmp( const char *s1, const char *s2 ) { Index: wince/wince.h =================================================================== RCS file: /home/cvs/ruby/wince/wince.h,v retrieving revision 1.1 diff -u -1 -p -r1.1 wince.h --- wince/wince.h 2002/12/02 07:57:17 1.1 +++ wince/wince.h 2002/12/20 14:27:03 @@ -56,3 +56,3 @@ extern "C" { -/* Win32 API redifinition. */ +/* Win32 API redifinition. */ @@ -60,5 +60,5 @@ extern "C" { #undef GetCommandLine - #define GetCommandLine GetCommandLineA -#else #define GetCommandLine GetCommandLineA +#else + #define GetCommandLine GetCommandLineA #endif @@ -143,4 +143,4 @@ char *strdup(const char * str); /* char *strerror(int errno); */ -int _strnicmp( const char *s1, const char *s2, size_t count ); - +int strnicmp( const char *s1, const char *s2, size_t count ); + #define strnicmp _strnicmp @@ -194,15 +194,15 @@ void wce_FreeCommandLine(void); char *strrchr( const char *p, int c ); - int _stricmp( const char *p1, const char *p2 ); - VOID ZeroMemory(PVOID p, DWORD length); - - #define isascii(c) ( (c>=0x00&&c<=0x7f)?1:0 ) - #define isspace(c) ( ((c>=0x09&&c<=0x0d)||c==0x20)?1:0 ) - #define isdigit(c) ( (c>=0x00&&c<=0x09)?1:0 ) - #define isupper(c) ( (c>='A'&&c<='Z')?1:0 ) - #define isalpha(c) ( ((c>='A'&&c<='Z')||(c>='a'&&c<='z'))?1:0 ) - #define isprint(c) ( (c>=0x20&&c<=0x7e)?1:0 ) - #define isalnum(c) ( (isalpha(c)||isdigit(c))?1:0 ) - #define iscntrl(c) ( ((c>=0x00&&c<=0x1f)||c==0x7f)?1:0 ) - #define islower(c) ( (c>='a'&&c<='z')?1:0 ) - #define ispunct(c) ( !(isalnum(c)||isspace(c))?1:0 ) + int stricmp( const char *p1, const char *p2 ); + VOID ZeroMemory(PVOID p, DWORD length); + + #define isascii(c) ( (c>=0x00&&c<=0x7f)?1:0 ) + #define isspace(c) ( ((c>=0x09&&c<=0x0d)||c==0x20)?1:0 ) + #define isdigit(c) ( (c>=0x00&&c<=0x09)?1:0 ) + #define isupper(c) ( (c>='A'&&c<='Z')?1:0 ) + #define isalpha(c) ( ((c>='A'&&c<='Z')||(c>='a'&&c<='z'))?1:0 ) + #define isprint(c) ( (c>=0x20&&c<=0x7e)?1:0 ) + #define isalnum(c) ( (isalpha(c)||isdigit(c))?1:0 ) + #define iscntrl(c) ( ((c>=0x00&&c<=0x1f)||c==0x7f)?1:0 ) + #define islower(c) ( (c>='a'&&c<='z')?1:0 ) + #define ispunct(c) ( !(isalnum(c)||isspace(c))?1:0 ) #define isxdigit(c) ( ((c>=0&&c<=9)||(c>='A'&&c<='F')||(c>='a'&&c<='f'))?1:0 ) それでは。 -- U.Nakamura