mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* suppress warnings on cygwin, mingw and mswin.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@16740 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
871913462f
commit
9ed3d64d1d
21 changed files with 133 additions and 73 deletions
|
@ -1,3 +1,7 @@
|
|||
Mon Jun 2 04:55:05 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* suppress warnings on cygwin, mingw and mswin.
|
||||
|
||||
Sat May 31 23:33:34 2008 Akinori MUSHA <knu@iDaemons.org>
|
||||
|
||||
* README, README.ja: Add a note about default C flags.
|
||||
|
|
24
dln.c
24
dln.c
|
@ -1689,31 +1689,31 @@ static char fbuf[MAXPATHLEN];
|
|||
|
||||
static char *
|
||||
dln_find_1(fname, path, exe_flag)
|
||||
char *fname;
|
||||
char *path;
|
||||
const char *fname;
|
||||
const char *path;
|
||||
int exe_flag; /* non 0 if looking for executable. */
|
||||
{
|
||||
register char *dp;
|
||||
register char *ep;
|
||||
register const char *dp;
|
||||
register const char *ep;
|
||||
register char *bp;
|
||||
struct stat st;
|
||||
#ifdef __MACOS__
|
||||
const char* mac_fullpath;
|
||||
#endif
|
||||
|
||||
if (!fname) return fname;
|
||||
if (fname[0] == '/') return fname;
|
||||
if (!fname) return (char *)fname;
|
||||
if (fname[0] == '/') return (char *)fname;
|
||||
if (strncmp("./", fname, 2) == 0 || strncmp("../", fname, 3) == 0)
|
||||
return fname;
|
||||
if (exe_flag && strchr(fname, '/')) return fname;
|
||||
return (char *)fname;
|
||||
if (exe_flag && strchr(fname, '/')) return (char *)fname;
|
||||
#ifdef DOSISH
|
||||
if (fname[0] == '\\') return fname;
|
||||
if (fname[0] == '\\') return (char *)fname;
|
||||
# ifdef DOSISH_DRIVE_LETTER
|
||||
if (strlen(fname) > 2 && fname[1] == ':') return fname;
|
||||
if (strlen(fname) > 2 && fname[1] == ':') return (char *)fname;
|
||||
# endif
|
||||
if (strncmp(".\\", fname, 2) == 0 || strncmp("..\\", fname, 3) == 0)
|
||||
return fname;
|
||||
if (exe_flag && strchr(fname, '\\')) return fname;
|
||||
return (char *)fname;
|
||||
if (exe_flag && strchr(fname, '\\')) return (char *)fname;
|
||||
#endif
|
||||
|
||||
for (dp = path;; dp = ++ep) {
|
||||
|
|
30
file.c
30
file.c
|
@ -2320,6 +2320,10 @@ rb_file_s_umask(argc, argv)
|
|||
#define USE_NTFS 0
|
||||
#endif
|
||||
|
||||
#ifdef DOSISH_DRIVE_LETTER
|
||||
#include <ctype.h>
|
||||
#endif
|
||||
|
||||
#if USE_NTFS
|
||||
#define istrailinggabage(x) ((x) == '.' || (x) == ' ')
|
||||
#else
|
||||
|
@ -2532,7 +2536,7 @@ file_expand_path(fname, dname, result)
|
|||
|
||||
if (s[0] == '~') {
|
||||
if (isdirsep(s[1]) || s[1] == '\0') {
|
||||
char *dir = getenv("HOME");
|
||||
const char *dir = getenv("HOME");
|
||||
|
||||
if (!dir) {
|
||||
rb_raise(rb_eArgError, "couldn't find HOME environment -- expanding `%s'", s);
|
||||
|
@ -2891,9 +2895,9 @@ rb_file_s_basename(argc, argv)
|
|||
VALUE *argv;
|
||||
{
|
||||
VALUE fname, fext, basename;
|
||||
char *name, *p;
|
||||
const char *name, *p;
|
||||
#if defined DOSISH_DRIVE_LETTER || defined DOSISH_UNC
|
||||
char *root;
|
||||
const char *root;
|
||||
#endif
|
||||
int f, n;
|
||||
|
||||
|
@ -3103,7 +3107,7 @@ rb_file_join(ary, sep)
|
|||
long len, i;
|
||||
int taint = 0;
|
||||
VALUE result, tmp;
|
||||
char *name, *tail;
|
||||
const char *name, *tail;
|
||||
|
||||
if (RARRAY(ary)->len == 0) return rb_str_new(0, 0);
|
||||
if (OBJ_TAINTED(ary)) taint = 1;
|
||||
|
@ -4288,7 +4292,7 @@ path_check_0(fpath, execpath)
|
|||
int execpath;
|
||||
{
|
||||
struct stat st;
|
||||
char *p0 = StringValueCStr(fpath);
|
||||
const char *p0 = StringValueCStr(fpath);
|
||||
char *p = 0, *s;
|
||||
|
||||
if (!is_absolute_path(p0)) {
|
||||
|
@ -4327,7 +4331,7 @@ path_check_0(fpath, execpath)
|
|||
|
||||
static int
|
||||
fpath_check(path)
|
||||
char *path;
|
||||
const char *path;
|
||||
{
|
||||
#if ENABLE_PATH_CHECK
|
||||
return path_check_0(rb_str_new2(path), Qfalse);
|
||||
|
@ -4338,10 +4342,10 @@ fpath_check(path)
|
|||
|
||||
int
|
||||
rb_path_check(path)
|
||||
char *path;
|
||||
const char *path;
|
||||
{
|
||||
#if ENABLE_PATH_CHECK
|
||||
char *p0, *p, *pend;
|
||||
const char *p0, *p, *pend;
|
||||
const char sep = PATH_SEP_CHAR;
|
||||
|
||||
if (!path) return 1;
|
||||
|
@ -4376,7 +4380,7 @@ is_macos_native_path(path)
|
|||
|
||||
static int
|
||||
file_load_ok(file)
|
||||
char *file;
|
||||
const char *file;
|
||||
{
|
||||
FILE *f;
|
||||
|
||||
|
@ -4394,8 +4398,8 @@ rb_find_file_ext(filep, ext)
|
|||
VALUE *filep;
|
||||
const char * const *ext;
|
||||
{
|
||||
char *path, *found;
|
||||
char *f = RSTRING(*filep)->ptr;
|
||||
const char *path, *found;
|
||||
const char *f = RSTRING(*filep)->ptr;
|
||||
VALUE fname;
|
||||
long i, j;
|
||||
|
||||
|
@ -4450,8 +4454,8 @@ rb_find_file(path)
|
|||
VALUE path;
|
||||
{
|
||||
VALUE tmp;
|
||||
char *f = StringValueCStr(path);
|
||||
char *lpath;
|
||||
const char *f = StringValueCStr(path);
|
||||
const char *lpath;
|
||||
|
||||
if (f[0] == '~') {
|
||||
path = rb_file_expand_path(path, Qnil);
|
||||
|
|
2
intern.h
2
intern.h
|
@ -277,7 +277,7 @@ VALUE rb_hash_lookup _((VALUE, VALUE));
|
|||
VALUE rb_hash_aset _((VALUE, VALUE, VALUE));
|
||||
VALUE rb_hash_delete_if _((VALUE));
|
||||
VALUE rb_hash_delete _((VALUE,VALUE));
|
||||
int rb_path_check _((char*));
|
||||
int rb_path_check _((const char*));
|
||||
int rb_env_path_tainted _((void));
|
||||
/* io.c */
|
||||
#define rb_defout rb_stdout
|
||||
|
|
11
io.c
11
io.c
|
@ -50,6 +50,9 @@
|
|||
#elif defined(HAVE_SYS_FCNTL_H)
|
||||
#include <sys/fcntl.h>
|
||||
#endif
|
||||
#ifdef __CYGWIN__
|
||||
#include <io.h>
|
||||
#endif
|
||||
|
||||
#if !HAVE_OFF_T && !defined(off_t)
|
||||
# define off_t long
|
||||
|
@ -429,7 +432,10 @@ static int
|
|||
wsplit_p(rb_io_t *fptr)
|
||||
{
|
||||
FILE *f = GetWriteFile(fptr);
|
||||
#if defined(HAVE_FCNTL) && defined(F_GETFL) && defined(O_NONBLOCK)
|
||||
int r;
|
||||
#endif
|
||||
|
||||
if (!(fptr->mode & FMODE_WSPLIT_INITIALIZED)) {
|
||||
struct stat buf;
|
||||
if (fstat(fileno(f), &buf) == 0 &&
|
||||
|
@ -4522,7 +4528,10 @@ next_argv()
|
|||
FILE *fr = rb_fopen(fn, "r");
|
||||
|
||||
if (ruby_inplace_mode) {
|
||||
struct stat st, st2;
|
||||
struct stat st;
|
||||
#ifndef NO_SAFE_RENAME
|
||||
struct stat st2;
|
||||
#endif
|
||||
VALUE str;
|
||||
FILE *fw;
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ extern double atanh _((double));
|
|||
#endif
|
||||
|
||||
#ifndef HAVE_CRYPT
|
||||
extern char *crypt _((char *, char *));
|
||||
extern char *crypt _((const char *, const char *));
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_DUP2
|
||||
|
|
|
@ -107,13 +107,15 @@ static char sccsid[] = "@(#)crypt.c 8.1 (Berkeley) 6/4/93";
|
|||
#define LARGEDATA
|
||||
#endif
|
||||
|
||||
int des_setkey(), des_cipher();
|
||||
|
||||
/* compile with "-DSTATIC=int" when profiling */
|
||||
#ifndef STATIC
|
||||
#define STATIC static
|
||||
#endif
|
||||
STATIC init_des(), init_perm(), permute();
|
||||
STATIC void init_des(), init_perm(), permute();
|
||||
#ifdef DEBUG
|
||||
STATIC prtab();
|
||||
STATIC void prtab();
|
||||
#endif
|
||||
|
||||
/* ==================================== */
|
||||
|
@ -299,7 +301,7 @@ typedef union {
|
|||
#define PERM3264(d,d0,d1,cpp,p) \
|
||||
{ C_block tblk; permute(cpp,&tblk,p,4); LOAD (d,d0,d1,tblk); }
|
||||
|
||||
STATIC
|
||||
STATIC void
|
||||
permute(cp, out, p, chars_in)
|
||||
unsigned char *cp;
|
||||
C_block *out;
|
||||
|
@ -377,46 +379,62 @@ static unsigned char PC2[] = { /* permuted choice table 2 */
|
|||
};
|
||||
|
||||
static unsigned char S[8][64] = { /* 48->32 bit substitution tables */
|
||||
{
|
||||
/* S[1] */
|
||||
14, 4, 13, 1, 2, 15, 11, 8, 3, 10, 6, 12, 5, 9, 0, 7,
|
||||
0, 15, 7, 4, 14, 2, 13, 1, 10, 6, 12, 11, 9, 5, 3, 8,
|
||||
4, 1, 14, 8, 13, 6, 2, 11, 15, 12, 9, 7, 3, 10, 5, 0,
|
||||
15, 12, 8, 2, 4, 9, 1, 7, 5, 11, 3, 14, 10, 0, 6, 13,
|
||||
},
|
||||
{
|
||||
/* S[2] */
|
||||
15, 1, 8, 14, 6, 11, 3, 4, 9, 7, 2, 13, 12, 0, 5, 10,
|
||||
3, 13, 4, 7, 15, 2, 8, 14, 12, 0, 1, 10, 6, 9, 11, 5,
|
||||
0, 14, 7, 11, 10, 4, 13, 1, 5, 8, 12, 6, 9, 3, 2, 15,
|
||||
13, 8, 10, 1, 3, 15, 4, 2, 11, 6, 7, 12, 0, 5, 14, 9,
|
||||
},
|
||||
{
|
||||
/* S[3] */
|
||||
10, 0, 9, 14, 6, 3, 15, 5, 1, 13, 12, 7, 11, 4, 2, 8,
|
||||
13, 7, 0, 9, 3, 4, 6, 10, 2, 8, 5, 14, 12, 11, 15, 1,
|
||||
13, 6, 4, 9, 8, 15, 3, 0, 11, 1, 2, 12, 5, 10, 14, 7,
|
||||
1, 10, 13, 0, 6, 9, 8, 7, 4, 15, 14, 3, 11, 5, 2, 12,
|
||||
},
|
||||
{
|
||||
/* S[4] */
|
||||
7, 13, 14, 3, 0, 6, 9, 10, 1, 2, 8, 5, 11, 12, 4, 15,
|
||||
13, 8, 11, 5, 6, 15, 0, 3, 4, 7, 2, 12, 1, 10, 14, 9,
|
||||
10, 6, 9, 0, 12, 11, 7, 13, 15, 1, 3, 14, 5, 2, 8, 4,
|
||||
3, 15, 0, 6, 10, 1, 13, 8, 9, 4, 5, 11, 12, 7, 2, 14,
|
||||
},
|
||||
{
|
||||
/* S[5] */
|
||||
2, 12, 4, 1, 7, 10, 11, 6, 8, 5, 3, 15, 13, 0, 14, 9,
|
||||
14, 11, 2, 12, 4, 7, 13, 1, 5, 0, 15, 10, 3, 9, 8, 6,
|
||||
4, 2, 1, 11, 10, 13, 7, 8, 15, 9, 12, 5, 6, 3, 0, 14,
|
||||
11, 8, 12, 7, 1, 14, 2, 13, 6, 15, 0, 9, 10, 4, 5, 3,
|
||||
},
|
||||
{
|
||||
/* S[6] */
|
||||
12, 1, 10, 15, 9, 2, 6, 8, 0, 13, 3, 4, 14, 7, 5, 11,
|
||||
10, 15, 4, 2, 7, 12, 9, 5, 6, 1, 13, 14, 0, 11, 3, 8,
|
||||
9, 14, 15, 5, 2, 8, 12, 3, 7, 0, 4, 10, 1, 13, 11, 6,
|
||||
4, 3, 2, 12, 9, 5, 15, 10, 11, 14, 1, 7, 6, 0, 8, 13,
|
||||
},
|
||||
{
|
||||
/* S[7] */
|
||||
4, 11, 2, 14, 15, 0, 8, 13, 3, 12, 9, 7, 5, 10, 6, 1,
|
||||
13, 0, 11, 7, 4, 9, 1, 10, 14, 3, 5, 12, 2, 15, 8, 6,
|
||||
1, 4, 11, 13, 12, 3, 7, 14, 10, 15, 6, 8, 0, 5, 9, 2,
|
||||
6, 11, 13, 8, 1, 4, 10, 7, 9, 5, 0, 15, 14, 2, 3, 12,
|
||||
},
|
||||
{
|
||||
/* S[8] */
|
||||
13, 2, 8, 4, 6, 15, 11, 1, 10, 9, 3, 14, 5, 0, 12, 7,
|
||||
1, 15, 13, 8, 10, 3, 7, 4, 12, 5, 6, 11, 0, 14, 9, 2,
|
||||
7, 11, 4, 1, 9, 12, 14, 2, 0, 6, 10, 13, 15, 3, 5, 8,
|
||||
2, 1, 14, 7, 4, 10, 8, 13, 15, 12, 9, 0, 3, 5, 6, 11,
|
||||
},
|
||||
};
|
||||
|
||||
static unsigned char P32Tr[] = { /* 32-bit permutation function */
|
||||
|
@ -580,6 +598,7 @@ static C_block KS[KS_SIZE];
|
|||
/*
|
||||
* Set up the key schedule from the key.
|
||||
*/
|
||||
int
|
||||
des_setkey(key)
|
||||
register const char *key;
|
||||
{
|
||||
|
@ -614,6 +633,7 @@ des_setkey(key)
|
|||
* NOTE: the performance of this routine is critically dependent on your
|
||||
* compiler and machine architecture.
|
||||
*/
|
||||
int
|
||||
des_cipher(in, out, salt, num_iter)
|
||||
const char *in;
|
||||
char *out;
|
||||
|
@ -734,7 +754,7 @@ des_cipher(in, out, salt, num_iter)
|
|||
* Initialize various tables. This need only be done once. It could even be
|
||||
* done at compile time, if the compiler were capable of that sort of thing.
|
||||
*/
|
||||
STATIC
|
||||
STATIC void
|
||||
init_des()
|
||||
{
|
||||
register int i, j;
|
||||
|
@ -878,7 +898,7 @@ init_des()
|
|||
*
|
||||
* "perm" must be all-zeroes on entry to this routine.
|
||||
*/
|
||||
STATIC
|
||||
STATIC void
|
||||
init_perm(perm, p, chars_in, chars_out)
|
||||
C_block perm[64/CHUNKBITS][1<<CHUNKBITS];
|
||||
unsigned char p[64];
|
||||
|
@ -902,6 +922,7 @@ init_perm(perm, p, chars_in, chars_out)
|
|||
/*
|
||||
* "setkey" routine (for backwards compatibility)
|
||||
*/
|
||||
int
|
||||
setkey(key)
|
||||
register const char *key;
|
||||
{
|
||||
|
@ -922,6 +943,7 @@ setkey(key)
|
|||
/*
|
||||
* "encrypt" routine (for backwards compatibility)
|
||||
*/
|
||||
int
|
||||
encrypt(block, flag)
|
||||
register char *block;
|
||||
int flag;
|
||||
|
@ -950,7 +972,7 @@ encrypt(block, flag)
|
|||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
STATIC
|
||||
STATIC void
|
||||
prtab(s, t, num_rows)
|
||||
char *s;
|
||||
unsigned char *t;
|
||||
|
|
4
parse.y
4
parse.y
|
@ -5891,6 +5891,10 @@ int
|
|||
ruby_parser_stack_on_heap()
|
||||
{
|
||||
#if defined(YYMALLOC)
|
||||
(void)rb_parser_realloc;
|
||||
(void)rb_parser_calloc;
|
||||
(void)nodetype;
|
||||
(void)nodeline;
|
||||
return Qfalse;
|
||||
#else
|
||||
return Qtrue;
|
||||
|
|
|
@ -1024,9 +1024,11 @@ int
|
|||
rb_proc_exec(str)
|
||||
const char *str;
|
||||
{
|
||||
#ifndef _WIN32
|
||||
const char *s = str;
|
||||
char *ss, *t;
|
||||
char **argv, **a;
|
||||
#endif
|
||||
|
||||
while (*str && ISSPACE(*str))
|
||||
str++;
|
||||
|
@ -1089,7 +1091,9 @@ proc_spawn_v(argv, prog)
|
|||
char **argv;
|
||||
char *prog;
|
||||
{
|
||||
#if defined(__human68k__)
|
||||
char *extension;
|
||||
#endif
|
||||
int status;
|
||||
|
||||
if (!prog)
|
||||
|
@ -1650,7 +1654,9 @@ rb_f_sleep(argc, argv)
|
|||
static VALUE
|
||||
proc_getpgrp()
|
||||
{
|
||||
#if defined(HAVE_GETPGRP) && defined(GETPGRP_VOID)
|
||||
int pgrp;
|
||||
#endif
|
||||
|
||||
rb_secure(2);
|
||||
#if defined(HAVE_GETPGRP) && defined(GETPGRP_VOID)
|
||||
|
|
4
re.c
4
re.c
|
@ -623,7 +623,7 @@ make_regexp(s, len, flags)
|
|||
int flags;
|
||||
{
|
||||
Regexp *rp;
|
||||
char *err;
|
||||
const char *err;
|
||||
|
||||
/* Handle escaped characters first. */
|
||||
|
||||
|
@ -846,7 +846,7 @@ rb_reg_prepare_re(re)
|
|||
}
|
||||
|
||||
if (need_recompile) {
|
||||
char *err;
|
||||
const char *err;
|
||||
|
||||
if (FL_TEST(re, KCODE_FIXED))
|
||||
rb_kcode_set_option(re);
|
||||
|
|
10
regex.c
10
regex.c
|
@ -164,7 +164,7 @@ static void store_jump _((char*, int, char*));
|
|||
static void insert_jump _((int, char*, char*, char*));
|
||||
static void store_jump_n _((char*, int, char*, unsigned));
|
||||
static void insert_jump_n _((int, char*, char*, char*, unsigned));
|
||||
static void insert_op _((int, char*, char*));
|
||||
/*static void insert_op _((int, char*, char*));*/
|
||||
static void insert_op_2 _((int, char*, char*, int, int));
|
||||
static int memcmp_translate _((unsigned char*, unsigned char*, int));
|
||||
|
||||
|
@ -508,6 +508,7 @@ utf8_firstbyte(c)
|
|||
#endif
|
||||
}
|
||||
|
||||
#if 0
|
||||
static void
|
||||
print_mbc(c)
|
||||
unsigned int c;
|
||||
|
@ -538,6 +539,7 @@ print_mbc(c)
|
|||
printf("%c%c", (int)(c >> BYTEWIDTH), (int)(c &0xff));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/* If the buffer isn't allocated when it comes in, use this. */
|
||||
#define INIT_BUF_SIZE 28
|
||||
|
@ -752,6 +754,7 @@ is_in_list(c, b)
|
|||
return is_in_list_sbc(c, b) || (current_mbctype ? is_in_list_mbc(c, b) : 0);
|
||||
}
|
||||
|
||||
#if 0
|
||||
static void
|
||||
print_partial_compiled_pattern(start, end)
|
||||
unsigned char *start;
|
||||
|
@ -1006,6 +1009,7 @@ print_compiled_pattern(bufp)
|
|||
|
||||
print_partial_compiled_pattern(buffer, buffer + bufp->used);
|
||||
}
|
||||
#endif
|
||||
|
||||
static char*
|
||||
calculate_must_string(start, end)
|
||||
|
@ -1208,7 +1212,7 @@ read_special(p, pend, pp)
|
|||
the `struct re_pattern_buffer' that bufp pointed to, after
|
||||
re_compile_pattern returns. */
|
||||
|
||||
char *
|
||||
const char *
|
||||
re_compile_pattern(pattern, size, bufp)
|
||||
const char *pattern;
|
||||
int size;
|
||||
|
@ -2580,6 +2584,7 @@ insert_jump_n(op, from, to, current_end, n)
|
|||
}
|
||||
|
||||
|
||||
#if 0
|
||||
/* Open up space at location THERE, and insert operation OP.
|
||||
CURRENT_END gives the end of the storage in use, so
|
||||
we know how much data to copy up.
|
||||
|
@ -2599,6 +2604,7 @@ insert_op(op, there, current_end)
|
|||
|
||||
there[0] = (char)op;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/* Open up space at location THERE, and insert operation OP followed by
|
||||
|
|
4
regex.h
4
regex.h
|
@ -184,7 +184,7 @@ typedef struct
|
|||
|
||||
#ifdef __STDC__
|
||||
|
||||
extern char *re_compile_pattern (const char *, int, struct re_pattern_buffer *);
|
||||
extern const char *re_compile_pattern (const char *, int, struct re_pattern_buffer *);
|
||||
void re_free_pattern (struct re_pattern_buffer *);
|
||||
/* Is this really advertised? */
|
||||
extern int re_adjust_startpos (struct re_pattern_buffer *, const char*, int, int, int);
|
||||
|
@ -205,7 +205,7 @@ extern int re_exec (const char *);
|
|||
|
||||
#else /* !__STDC__ */
|
||||
|
||||
extern char *re_compile_pattern ();
|
||||
extern const char *re_compile_pattern ();
|
||||
void re_free_regexp ();
|
||||
/* Is this really advertised? */
|
||||
extern int re_adjust_startpos ();
|
||||
|
|
7
ruby.c
7
ruby.c
|
@ -809,6 +809,9 @@ proc_options(argc, argv)
|
|||
}
|
||||
else {
|
||||
script = argv[0];
|
||||
#if defined DOSISH || defined __CYGWIN__
|
||||
translate_char(argv[0], '\\', '/');
|
||||
#endif
|
||||
if (script[0] == '\0') {
|
||||
script = "-";
|
||||
}
|
||||
|
@ -825,10 +828,10 @@ proc_options(argc, argv)
|
|||
if (!script) script = argv[0];
|
||||
script = ruby_sourcefile = rb_source_filename(script);
|
||||
script_node = NEW_NEWLINE(0);
|
||||
}
|
||||
#if defined DOSISH || defined __CYGWIN__
|
||||
translate_char(script, '\\', '/');
|
||||
translate_char(ruby_sourcefile, '\\', '/');
|
||||
#endif
|
||||
}
|
||||
argc--; argv++;
|
||||
}
|
||||
}
|
||||
|
|
4
signal.c
4
signal.c
|
@ -685,11 +685,13 @@ struct trap_arg {
|
|||
VALUE sig, cmd;
|
||||
};
|
||||
|
||||
#if USE_TRAP_MASK
|
||||
# ifdef HAVE_SIGPROCMASK
|
||||
static sigset_t trap_last_mask;
|
||||
# else
|
||||
static int trap_last_mask;
|
||||
# endif
|
||||
#endif
|
||||
|
||||
static RETSIGTYPE sigexit _((int));
|
||||
static RETSIGTYPE
|
||||
|
@ -991,6 +993,7 @@ install_nativethread_sighandler(signum, handler)
|
|||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(SIGCLD) || defined(SIGCHLD)
|
||||
static void
|
||||
init_sigchld(sig)
|
||||
int sig;
|
||||
|
@ -1032,6 +1035,7 @@ init_sigchld(sig)
|
|||
trap_last_mask = mask;
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Many operating systems allow signals to be sent to running
|
||||
|
|
|
@ -718,7 +718,7 @@ rb_f_sprintf(argc, argv)
|
|||
fval = RFLOAT(rb_Float(val))->value;
|
||||
#if defined(_WIN32) && !defined(__BORLANDC__)
|
||||
if (isnan(fval) || isinf(fval)) {
|
||||
char *expr;
|
||||
const char *expr;
|
||||
|
||||
if (isnan(fval)) {
|
||||
expr = "NaN";
|
||||
|
|
2
string.c
2
string.c
|
@ -4479,7 +4479,7 @@ static VALUE
|
|||
rb_str_crypt(str, salt)
|
||||
VALUE str, salt;
|
||||
{
|
||||
extern char *crypt();
|
||||
extern char *crypt _((const char *, const char*));
|
||||
VALUE result;
|
||||
const char *s;
|
||||
|
||||
|
|
5
time.c
5
time.c
|
@ -759,7 +759,10 @@ make_time_t(tptr, utc_p)
|
|||
int utc_p;
|
||||
{
|
||||
time_t t;
|
||||
struct tm *tmp, buf;
|
||||
#ifdef NEGATIVE_TIME_T
|
||||
struct tm *tmp;
|
||||
#endif
|
||||
struct tm buf;
|
||||
buf = *tptr;
|
||||
if (utc_p) {
|
||||
#if defined(HAVE_TIMEGM)
|
||||
|
|
9
util.c
9
util.c
|
@ -21,6 +21,9 @@
|
|||
#ifdef _WIN32
|
||||
#include "missing/file.h"
|
||||
#endif
|
||||
#if defined(__CYGWIN32__) || defined(_WIN32)
|
||||
#include <io.h>
|
||||
#endif
|
||||
|
||||
#include "util.h"
|
||||
#ifndef HAVE_STRING_H
|
||||
|
@ -228,6 +231,12 @@ fallback:
|
|||
}
|
||||
|
||||
#if defined(__CYGWIN32__) || defined(_WIN32)
|
||||
#if defined __CYGWIN32__ || defined __MINGW32__
|
||||
extern int _open(const char *, int, ...);
|
||||
extern int _close(int);
|
||||
extern int _unlink(const char *);
|
||||
#endif
|
||||
|
||||
static int
|
||||
valid_filename(char *s)
|
||||
{
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
#define RUBY_VERSION "1.8.7"
|
||||
#define RUBY_RELEASE_DATE "2008-05-31"
|
||||
#define RUBY_RELEASE_DATE "2008-06-02"
|
||||
#define RUBY_VERSION_CODE 187
|
||||
#define RUBY_RELEASE_CODE 20080531
|
||||
#define RUBY_RELEASE_CODE 20080602
|
||||
#define RUBY_PATCHLEVEL 5000
|
||||
|
||||
#define RUBY_VERSION_MAJOR 1
|
||||
#define RUBY_VERSION_MINOR 8
|
||||
#define RUBY_VERSION_TEENY 7
|
||||
#define RUBY_RELEASE_YEAR 2008
|
||||
#define RUBY_RELEASE_MONTH 5
|
||||
#define RUBY_RELEASE_DAY 31
|
||||
#define RUBY_RELEASE_MONTH 6
|
||||
#define RUBY_RELEASE_DAY 2
|
||||
|
||||
#ifdef RUBY_EXTERN
|
||||
RUBY_EXTERN const char ruby_version[];
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
#include <stdlib.h>
|
||||
#include <errno.h>
|
||||
#include <assert.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#include <windows.h>
|
||||
#include <winbase.h>
|
||||
|
@ -208,7 +209,7 @@ rb_w32_map_errno(DWORD winerr)
|
|||
|
||||
#define map_errno rb_w32_map_errno
|
||||
|
||||
static char *NTLoginName;
|
||||
static const char *NTLoginName;
|
||||
|
||||
#ifdef WIN95
|
||||
static DWORD Win32System = (DWORD)-1;
|
||||
|
@ -448,10 +449,6 @@ init_env(void)
|
|||
void
|
||||
NtInitialize(int *argc, char ***argv)
|
||||
{
|
||||
|
||||
WORD version;
|
||||
int ret;
|
||||
|
||||
#if _MSC_VER >= 1400
|
||||
static void set_pioinfo_extra(void);
|
||||
|
||||
|
@ -490,7 +487,7 @@ NtInitialize(int *argc, char ***argv)
|
|||
char *
|
||||
getlogin()
|
||||
{
|
||||
return NTLoginName;
|
||||
return (char *)NTLoginName;
|
||||
}
|
||||
|
||||
#define MAXCHILDNUM 256 /* max num of child processes */
|
||||
|
@ -505,15 +502,6 @@ static struct ChildRecord {
|
|||
for (v = ChildRecord; v < ChildRecord + sizeof(ChildRecord) / sizeof(ChildRecord[0]); ++v)
|
||||
#define END_FOREACH_CHILD } while (0)
|
||||
|
||||
static struct ChildRecord *
|
||||
FindFirstChildSlot(void)
|
||||
{
|
||||
FOREACH_CHILD(child) {
|
||||
if (child->pid) return child;
|
||||
} END_FOREACH_CHILD;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static struct ChildRecord *
|
||||
FindChildSlot(rb_pid_t pid)
|
||||
{
|
||||
|
@ -665,7 +653,7 @@ rb_w32_get_osfhandle(int fh)
|
|||
}
|
||||
|
||||
rb_pid_t
|
||||
pipe_exec(char *cmd, int mode, FILE **fpr, FILE **fpw)
|
||||
pipe_exec(const char *cmd, int mode, FILE **fpr, FILE **fpw)
|
||||
{
|
||||
struct ChildRecord* child;
|
||||
HANDLE hReadIn, hReadOut;
|
||||
|
@ -804,7 +792,7 @@ pipe_exec(char *cmd, int mode, FILE **fpr, FILE **fpw)
|
|||
extern VALUE rb_last_status;
|
||||
|
||||
int
|
||||
do_spawn(int mode, char *cmd)
|
||||
do_spawn(int mode, const char *cmd)
|
||||
{
|
||||
struct ChildRecord *child;
|
||||
DWORD exitcode;
|
||||
|
@ -841,7 +829,7 @@ do_spawn(int mode, char *cmd)
|
|||
}
|
||||
|
||||
int
|
||||
do_aspawn(int mode, char *prog, char **argv)
|
||||
do_aspawn(int mode, const char *prog, char **argv)
|
||||
{
|
||||
char *cmd, *p, *q, *s, **t;
|
||||
int len, n, bs, quote;
|
||||
|
@ -1211,7 +1199,7 @@ skipspace(char *ptr)
|
|||
int
|
||||
rb_w32_cmdvector(const char *cmd, char ***vec)
|
||||
{
|
||||
int cmdlen, globbing, len, i;
|
||||
int globbing, len;
|
||||
int elements, strsz, done;
|
||||
int slashes, escape;
|
||||
char *ptr, *base, *buffer, *cmdline;
|
||||
|
@ -3936,9 +3924,7 @@ int
|
|||
rb_w32_utime(const char *path, struct utimbuf *times)
|
||||
{
|
||||
HANDLE hFile;
|
||||
SYSTEMTIME st;
|
||||
FILETIME atime, mtime;
|
||||
struct tm *tm;
|
||||
struct stat stat;
|
||||
int ret = 0;
|
||||
|
||||
|
|
|
@ -159,7 +159,7 @@ struct timezone {
|
|||
#endif
|
||||
extern void NtInitialize(int *, char ***);
|
||||
extern int rb_w32_cmdvector(const char *, char ***);
|
||||
extern rb_pid_t pipe_exec(char *, int, FILE **, FILE **);
|
||||
extern rb_pid_t pipe_exec(const char *, int, FILE **, FILE **);
|
||||
extern int flock(int fd, int oper);
|
||||
extern int rb_w32_accept(int, struct sockaddr *, int *);
|
||||
extern int rb_w32_bind(int, struct sockaddr *, int);
|
||||
|
@ -205,8 +205,8 @@ extern int chown(const char *, int, int);
|
|||
extern int link(char *, char *);
|
||||
extern int gettimeofday(struct timeval *, struct timezone *);
|
||||
extern rb_pid_t waitpid (rb_pid_t, int *, int);
|
||||
extern int do_spawn(int, char *);
|
||||
extern int do_aspawn(int, char *, char **);
|
||||
extern int do_spawn(int, const char *);
|
||||
extern int do_aspawn(int, const char *, char **);
|
||||
extern int kill(int, int);
|
||||
extern int fcntl(int, int, ...);
|
||||
extern rb_pid_t rb_w32_getpid(void);
|
||||
|
|
Loading…
Add table
Reference in a new issue