* configure.in (AC_HEADER_DIRENT): added.
* include/ruby/ruby.h (NUM2INT, rb_special_const_p): returns true and false instead of Qtrue and Qfalse for platforms where VALUE is bigger than int. * gc.c (gc_stress_set), ext/openssl/ossl_asn1.c (decode_bool): got rid of variables named `bool'. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22922 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
11e89eb719
commit
e9b98f413e
11
ChangeLog
11
ChangeLog
@ -1,3 +1,14 @@
|
|||||||
|
Fri Mar 13 10:42:19 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
|
* configure.in (AC_HEADER_DIRENT): added.
|
||||||
|
|
||||||
|
* include/ruby/ruby.h (NUM2INT, rb_special_const_p): returns true
|
||||||
|
and false instead of Qtrue and Qfalse for platforms where VALUE
|
||||||
|
is bigger than int.
|
||||||
|
|
||||||
|
* gc.c (gc_stress_set), ext/openssl/ossl_asn1.c (decode_bool): go
|
||||||
|
rid of variables named `bool'.
|
||||||
|
|
||||||
Fri Mar 13 10:16:36 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
Fri Mar 13 10:16:36 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
* configure.in (struct stat.st_size): may be huge.
|
* configure.in (struct stat.st_size): may be huge.
|
||||||
|
@ -887,6 +887,7 @@ fi
|
|||||||
dnl Checks for header files.
|
dnl Checks for header files.
|
||||||
AC_HEADER_DIRENT
|
AC_HEADER_DIRENT
|
||||||
dnl AC_HEADER_STDC has been checked in AC_USE_SYSTEM_EXTENSIONS
|
dnl AC_HEADER_STDC has been checked in AC_USE_SYSTEM_EXTENSIONS
|
||||||
|
AC_HEADER_STDBOOL
|
||||||
AC_HEADER_SYS_WAIT
|
AC_HEADER_SYS_WAIT
|
||||||
AC_CHECK_HEADERS(limits.h sys/file.h sys/ioctl.h sys/syscall.h\
|
AC_CHECK_HEADERS(limits.h sys/file.h sys/ioctl.h sys/syscall.h\
|
||||||
fcntl.h sys/fcntl.h sys/select.h sys/time.h sys/times.h sys/param.h\
|
fcntl.h sys/fcntl.h sys/select.h sys/time.h sys/times.h sys/param.h\
|
||||||
|
@ -306,14 +306,14 @@ obj_to_asn1derstr(VALUE obj)
|
|||||||
static VALUE
|
static VALUE
|
||||||
decode_bool(unsigned char* der, int length)
|
decode_bool(unsigned char* der, int length)
|
||||||
{
|
{
|
||||||
int bool;
|
int val;
|
||||||
const unsigned char *p;
|
const unsigned char *p;
|
||||||
|
|
||||||
p = der;
|
p = der;
|
||||||
if((bool = d2i_ASN1_BOOLEAN(NULL, &p, length)) < 0)
|
if((val = d2i_ASN1_BOOLEAN(NULL, &p, length)) < 0)
|
||||||
ossl_raise(eASN1Error, NULL);
|
ossl_raise(eASN1Error, NULL);
|
||||||
|
|
||||||
return bool ? Qtrue : Qfalse;
|
return val ? Qtrue : Qfalse;
|
||||||
}
|
}
|
||||||
|
|
||||||
static VALUE
|
static VALUE
|
||||||
|
10
gc.c
10
gc.c
@ -480,12 +480,12 @@ gc_stress_get(VALUE self)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
static VALUE
|
static VALUE
|
||||||
gc_stress_set(VALUE self, VALUE bool)
|
gc_stress_set(VALUE self, VALUE flag)
|
||||||
{
|
{
|
||||||
rb_objspace_t *objspace = &rb_objspace;
|
rb_objspace_t *objspace = &rb_objspace;
|
||||||
rb_secure(2);
|
rb_secure(2);
|
||||||
ruby_gc_stress = RTEST(bool);
|
ruby_gc_stress = RTEST(flag);
|
||||||
return bool;
|
return flag;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -1636,7 +1636,7 @@ gc_mark_children(rb_objspace_t *objspace, VALUE ptr, int lev)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
rb_bug("rb_gc_mark(): unknown data type 0x%lx(%p) %s",
|
rb_bug("rb_gc_mark(): unknown data type 0x%x(%p) %s",
|
||||||
BUILTIN_TYPE(obj), (void *)obj,
|
BUILTIN_TYPE(obj), (void *)obj,
|
||||||
is_pointer_to_heap(objspace, obj) ? "corrupted object" : "non object");
|
is_pointer_to_heap(objspace, obj) ? "corrupted object" : "non object");
|
||||||
}
|
}
|
||||||
@ -1934,7 +1934,7 @@ obj_free(rb_objspace_t *objspace, VALUE obj)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
rb_bug("gc_sweep(): unknown data type 0x%lx(%p)",
|
rb_bug("gc_sweep(): unknown data type 0x%x(%p)",
|
||||||
BUILTIN_TYPE(obj), (void*)obj);
|
BUILTIN_TYPE(obj), (void*)obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -103,6 +103,13 @@ typedef unsigned LONG_LONG ID;
|
|||||||
# error ---->> ruby requires sizeof(void*) == sizeof(long) to be compiled. <<----
|
# error ---->> ruby requires sizeof(void*) == sizeof(long) to be compiled. <<----
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
typedef char ruby_check_sizeof_int[SIZEOF_INT == sizeof(int) ? 1 : -1];
|
||||||
|
typedef char ruby_check_sizeof_long[SIZEOF_LONG == sizeof(long) ? 1 : -1];
|
||||||
|
#ifdef SIZEOF_LONG_LONG
|
||||||
|
typedef char ruby_check_sizeof_long_long[SIZEOF_LONG_LONG == sizeof(LONG_LONG) ? 1 : -1];
|
||||||
|
#endif
|
||||||
|
typedef char ruby_check_sizeof_voidp[SIZEOF_VOIDP == sizeof(void*) ? 1 : -1];
|
||||||
|
|
||||||
#if defined PRIdPTR && !defined PRI_VALUE_PREFIX
|
#if defined PRIdPTR && !defined PRI_VALUE_PREFIX
|
||||||
#define PRIdVALUE PRIdPTR
|
#define PRIdVALUE PRIdPTR
|
||||||
#define PRIiVALUE PRIiPTR
|
#define PRIiVALUE PRIiPTR
|
||||||
@ -302,6 +309,28 @@ enum ruby_special_consts {
|
|||||||
RUBY_SPECIAL_SHIFT = 8
|
RUBY_SPECIAL_SHIFT = 8
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#if defined HAVE_STDBOOL_H
|
||||||
|
# include <stdbool.h>
|
||||||
|
#elif defined __cplusplus
|
||||||
|
typedef bool _Bool;
|
||||||
|
#else
|
||||||
|
# ifndef HAVE__BOOL
|
||||||
|
# define _Bool signed char
|
||||||
|
# endif
|
||||||
|
# ifndef bool
|
||||||
|
# define bool _Bool
|
||||||
|
# endif
|
||||||
|
# ifndef false
|
||||||
|
# define false 0
|
||||||
|
# endif
|
||||||
|
# ifndef true
|
||||||
|
# define true 1
|
||||||
|
# endif
|
||||||
|
# ifndef __bool_true_false_are_defined
|
||||||
|
# define __bool_true_false_are_defined 1
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#define Qfalse ((VALUE)RUBY_Qfalse)
|
#define Qfalse ((VALUE)RUBY_Qfalse)
|
||||||
#define Qtrue ((VALUE)RUBY_Qtrue)
|
#define Qtrue ((VALUE)RUBY_Qtrue)
|
||||||
#define Qnil ((VALUE)RUBY_Qnil)
|
#define Qnil ((VALUE)RUBY_Qnil)
|
||||||
@ -375,7 +404,7 @@ enum ruby_value_type {
|
|||||||
#define T_ZOMBIE RUBY_T_ZOMBIE
|
#define T_ZOMBIE RUBY_T_ZOMBIE
|
||||||
#define T_MASK RUBY_T_MASK
|
#define T_MASK RUBY_T_MASK
|
||||||
|
|
||||||
#define BUILTIN_TYPE(x) (((struct RBasic*)(x))->flags & T_MASK)
|
#define BUILTIN_TYPE(x) (int)(((struct RBasic*)(x))->flags & T_MASK)
|
||||||
|
|
||||||
#define TYPE(x) rb_type((VALUE)(x))
|
#define TYPE(x) rb_type((VALUE)(x))
|
||||||
|
|
||||||
@ -439,7 +468,7 @@ long rb_fix2int(VALUE);
|
|||||||
static inline int
|
static inline int
|
||||||
NUM2INT(VALUE x)
|
NUM2INT(VALUE x)
|
||||||
{
|
{
|
||||||
return FIXNUM_P(x) ? FIX2INT(x) : rb_num2int(x);
|
return FIXNUM_P(x) ? FIX2INT(x) : (int)rb_num2int(x);
|
||||||
}
|
}
|
||||||
unsigned long rb_num2uint(VALUE);
|
unsigned long rb_num2uint(VALUE);
|
||||||
#define NUM2UINT(x) ((unsigned int)rb_num2uint(x))
|
#define NUM2UINT(x) ((unsigned int)rb_num2uint(x))
|
||||||
@ -1142,8 +1171,8 @@ rb_type(VALUE obj)
|
|||||||
static inline int
|
static inline int
|
||||||
rb_special_const_p(VALUE obj)
|
rb_special_const_p(VALUE obj)
|
||||||
{
|
{
|
||||||
if (SPECIAL_CONST_P(obj)) return Qtrue;
|
if (SPECIAL_CONST_P(obj)) return true;
|
||||||
return Qfalse;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
#include "ruby/missing.h"
|
#include "ruby/missing.h"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user