mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
statement experssion is a GCCism
should mark as such. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61557 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
a5a5714b77
commit
a6b50f379d
3 changed files with 12 additions and 12 deletions
|
@ -1151,10 +1151,10 @@ void *rb_check_typeddata(VALUE, const rb_data_type_t *);
|
||||||
(void)((sval) = (type *)DATA_PTR(result));
|
(void)((sval) = (type *)DATA_PTR(result));
|
||||||
|
|
||||||
#ifdef __GNUC__
|
#ifdef __GNUC__
|
||||||
#define Data_Make_Struct(klass,type,mark,free,sval) ({\
|
#define Data_Make_Struct(klass,type,mark,free,sval) RB_GNUC_EXTENSION_BLOCK(\
|
||||||
Data_Make_Struct0(data_struct_obj, klass, type, sizeof(type), mark, free, sval); \
|
Data_Make_Struct0(data_struct_obj, klass, type, sizeof(type), mark, free, sval); \
|
||||||
data_struct_obj; \
|
data_struct_obj \
|
||||||
})
|
)
|
||||||
#else
|
#else
|
||||||
#define Data_Make_Struct(klass,type,mark,free,sval) (\
|
#define Data_Make_Struct(klass,type,mark,free,sval) (\
|
||||||
rb_data_object_make((klass),(RUBY_DATA_FUNC)(mark),(RUBY_DATA_FUNC)(free),(void **)&(sval),sizeof(type)) \
|
rb_data_object_make((klass),(RUBY_DATA_FUNC)(mark),(RUBY_DATA_FUNC)(free),(void **)&(sval),sizeof(type)) \
|
||||||
|
@ -1169,10 +1169,10 @@ void *rb_check_typeddata(VALUE, const rb_data_type_t *);
|
||||||
(void)((sval) = (type *)DATA_PTR(result));
|
(void)((sval) = (type *)DATA_PTR(result));
|
||||||
|
|
||||||
#ifdef __GNUC__
|
#ifdef __GNUC__
|
||||||
#define TypedData_Make_Struct(klass, type, data_type, sval) ({\
|
#define TypedData_Make_Struct(klass, type, data_type, sval) RB_GNUC_EXTENSION_BLOCK(\
|
||||||
TypedData_Make_Struct0(data_struct_obj, klass, type, sizeof(type), data_type, sval); \
|
TypedData_Make_Struct0(data_struct_obj, klass, type, sizeof(type), data_type, sval); \
|
||||||
data_struct_obj; \
|
data_struct_obj \
|
||||||
})
|
)
|
||||||
#else
|
#else
|
||||||
#define TypedData_Make_Struct(klass, type, data_type, sval) (\
|
#define TypedData_Make_Struct(klass, type, data_type, sval) (\
|
||||||
rb_data_typed_object_make((klass),(data_type),(void **)&(sval),sizeof(type)) \
|
rb_data_typed_object_make((klass),(data_type),(void **)&(sval),sizeof(type)) \
|
||||||
|
|
|
@ -109,7 +109,7 @@ extern "C" {
|
||||||
__builtin_mul_overflow_p((a), (b), (__typeof__(a * b))0)
|
__builtin_mul_overflow_p((a), (b), (__typeof__(a * b))0)
|
||||||
#elif defined HAVE_BUILTIN___BUILTIN_MUL_OVERFLOW
|
#elif defined HAVE_BUILTIN___BUILTIN_MUL_OVERFLOW
|
||||||
#define MUL_OVERFLOW_P(a, b) \
|
#define MUL_OVERFLOW_P(a, b) \
|
||||||
({__typeof__(a) c; __builtin_mul_overflow((a), (b), &c);})
|
RB_GNUC_EXTENSION_BLOCK(__typeof__(a) c; __builtin_mul_overflow((a), (b), &c))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define MUL_OVERFLOW_SIGNED_INTEGER_P(a, b, min, max) ( \
|
#define MUL_OVERFLOW_SIGNED_INTEGER_P(a, b, min, max) ( \
|
||||||
|
@ -122,10 +122,10 @@ extern "C" {
|
||||||
#ifdef HAVE_BUILTIN___BUILTIN_MUL_OVERFLOW_P
|
#ifdef HAVE_BUILTIN___BUILTIN_MUL_OVERFLOW_P
|
||||||
/* __builtin_mul_overflow_p can take bitfield */
|
/* __builtin_mul_overflow_p can take bitfield */
|
||||||
/* and GCC permits bitfields for integers other than int */
|
/* and GCC permits bitfields for integers other than int */
|
||||||
#define MUL_OVERFLOW_FIXNUM_P(a, b) ({ \
|
#define MUL_OVERFLOW_FIXNUM_P(a, b) RB_GNUC_EXTENSION_BLOCK( \
|
||||||
struct { long fixnum : SIZEOF_LONG * CHAR_BIT - 1; } c; \
|
struct { long fixnum : SIZEOF_LONG * CHAR_BIT - 1; } c; \
|
||||||
__builtin_mul_overflow_p((a), (b), c.fixnum); \
|
__builtin_mul_overflow_p((a), (b), c.fixnum); \
|
||||||
})
|
)
|
||||||
#else
|
#else
|
||||||
#define MUL_OVERFLOW_FIXNUM_P(a, b) MUL_OVERFLOW_SIGNED_INTEGER_P(a, b, FIXNUM_MIN, FIXNUM_MAX)
|
#define MUL_OVERFLOW_FIXNUM_P(a, b) MUL_OVERFLOW_SIGNED_INTEGER_P(a, b, FIXNUM_MIN, FIXNUM_MAX)
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -9,10 +9,10 @@ typedef unsigned int rb_atomic_t;
|
||||||
# define ATOMIC_DEC(var) __atomic_fetch_sub(&(var), 1, __ATOMIC_SEQ_CST)
|
# define ATOMIC_DEC(var) __atomic_fetch_sub(&(var), 1, __ATOMIC_SEQ_CST)
|
||||||
# define ATOMIC_OR(var, val) __atomic_fetch_or(&(var), (val), __ATOMIC_SEQ_CST)
|
# define ATOMIC_OR(var, val) __atomic_fetch_or(&(var), (val), __ATOMIC_SEQ_CST)
|
||||||
# define ATOMIC_EXCHANGE(var, val) __atomic_exchange_n(&(var), (val), __ATOMIC_SEQ_CST)
|
# define ATOMIC_EXCHANGE(var, val) __atomic_exchange_n(&(var), (val), __ATOMIC_SEQ_CST)
|
||||||
# define ATOMIC_CAS(var, oldval, newval) \
|
# define ATOMIC_CAS(var, oldval, newval) RB_GNUC_EXTENSION_BLOCK( \
|
||||||
({ __typeof__(var) oldvaldup = (oldval); /* oldval should not be modified */ \
|
__typeof__(var) oldvaldup = (oldval); /* oldval should not be modified */ \
|
||||||
__atomic_compare_exchange_n(&(var), &oldvaldup, (newval), 0, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST); \
|
__atomic_compare_exchange_n(&(var), &oldvaldup, (newval), 0, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST); \
|
||||||
oldvaldup; })
|
oldvaldup )
|
||||||
|
|
||||||
# define ATOMIC_SIZE_ADD(var, val) __atomic_fetch_add(&(var), (val), __ATOMIC_SEQ_CST)
|
# define ATOMIC_SIZE_ADD(var, val) __atomic_fetch_add(&(var), (val), __ATOMIC_SEQ_CST)
|
||||||
# define ATOMIC_SIZE_SUB(var, val) __atomic_fetch_sub(&(var), (val), __ATOMIC_SEQ_CST)
|
# define ATOMIC_SIZE_SUB(var, val) __atomic_fetch_sub(&(var), (val), __ATOMIC_SEQ_CST)
|
||||||
|
|
Loading…
Reference in a new issue