From de9d264026c870afd79a8843764ccbf60367bb0e Mon Sep 17 00:00:00 2001 From: shyouhei Date: Fri, 19 Jan 2018 09:12:06 +0000 Subject: there is no guarantee that mode_t is as wide as int POSIX only defines mode_t to be "an integer typea", and in fact MacOS defines it to be uint16_t. We didn't have NUM2USHORT before so it did not make sense but now that we have it. Why not check apptopriately. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61950 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- include/ruby/ruby.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include/ruby/ruby.h') diff --git a/include/ruby/ruby.h b/include/ruby/ruby.h index f244d140fb..1a1c6bd4a8 100644 --- a/include/ruby/ruby.h +++ b/include/ruby/ruby.h @@ -113,6 +113,9 @@ typedef char ruby_check_sizeof_voidp[SIZEOF_VOIDP == sizeof(void*) ? 1 : -1]; #ifndef PRI_LONG_PREFIX #define PRI_LONG_PREFIX "l" #endif +#ifndef PRI_SHORT_PREFIX +#define PRI_SHORT_PREFIX "h" +#endif #if SIZEOF_LONG == 8 #define PRI_64_PREFIX PRI_LONG_PREFIX @@ -1571,6 +1574,7 @@ rb_num2char_inline(VALUE x) #define LONG2NUM(x) RB_LONG2NUM(x) #define ULONG2NUM(x) RB_ULONG2NUM(x) +#define USHORT2NUM(x) RB_INT2FIX(x) #define NUM2CHR(x) RB_NUM2CHR(x) #define CHR2FIX(x) RB_CHR2FIX(x) -- cgit v1.2.3