зеркало из https://github.com/github/ruby.git
conversions.h: PTR2NUM
* ext/fiddle/conversions.h (PTR2NUM): use signed integer to make Fixnum for negative values. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53081 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
d10d5a974d
Коммит
34a0df159b
|
@ -1,3 +1,8 @@
|
||||||
|
Sun Dec 13 18:35:11 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
|
* ext/fiddle/conversions.h (PTR2NUM): use signed integer to make
|
||||||
|
Fixnum for negative values.
|
||||||
|
|
||||||
Sun Dec 13 18:33:41 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
Sun Dec 13 18:33:41 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
* pack.c (pack_pack): always check index range against the
|
* pack.c (pack_pack): always check index range against the
|
||||||
|
|
|
@ -33,11 +33,11 @@ VALUE generic_to_value(VALUE rettype, fiddle_generic retval);
|
||||||
#define GENERIC2VALUE(_type, _retval) generic_to_value((_type), (_retval))
|
#define GENERIC2VALUE(_type, _retval) generic_to_value((_type), (_retval))
|
||||||
|
|
||||||
#if SIZEOF_VOIDP == SIZEOF_LONG
|
#if SIZEOF_VOIDP == SIZEOF_LONG
|
||||||
# define PTR2NUM(x) (ULONG2NUM((unsigned long)(x)))
|
# define PTR2NUM(x) (LONG2NUM((long)(x)))
|
||||||
# define NUM2PTR(x) ((void*)(NUM2ULONG(x)))
|
# define NUM2PTR(x) ((void*)(NUM2ULONG(x)))
|
||||||
#else
|
#else
|
||||||
/* # error --->> Ruby/DL2 requires sizeof(void*) == sizeof(long) to be compiled. <<--- */
|
/* # error --->> Ruby/DL2 requires sizeof(void*) == sizeof(long) to be compiled. <<--- */
|
||||||
# define PTR2NUM(x) (ULL2NUM((unsigned long long)(x)))
|
# define PTR2NUM(x) (LL2NUM((LONG_LONG)(x)))
|
||||||
# define NUM2PTR(x) ((void*)(NUM2ULL(x)))
|
# define NUM2PTR(x) ((void*)(NUM2ULL(x)))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче