ruby-changes:52852
From: nobu <ko1@a...>
Date: Sun, 14 Oct 2018 01:21:14 +0900 (JST)
Subject: [ruby-changes:52852] nobu:r65064 (trunk): Define PRIdPTR etc
nobu 2018-10-14 01:21:07 +0900 (Sun, 14 Oct 2018) New Revision: 65064 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=65064 Log: Define PRIdPTR etc Modified files: trunk/configure.ac trunk/include/ruby/ruby.h trunk/win32/Makefile.sub Index: configure.ac =================================================================== --- configure.ac (revision 65063) +++ configure.ac (revision 65064) @@ -1596,6 +1596,9 @@ RUBY_DEFINT(int128_t, 16) https://github.com/ruby/ruby/blob/trunk/configure.ac#L1596 RUBY_DEFINT(uint128_t, 16, unsigned) RUBY_DEFINT(intptr_t, void*) RUBY_DEFINT(uintptr_t, void*, unsigned) +AS_IF([test "x$rb_cv_type_intptr_t" != xno], [ + RUBY_CHECK_PRINTF_PREFIX(intptr_t, '' ll I64 l, PTR) +]) RUBY_DEFINT(ssize_t, size_t, [], [@%:@include <sys/types.h>]) dnl may differ from int, so not use AC_TYPE_SSIZE_T. AS_IF([test "x$rb_cv_type_int64_t" != xno], [ RUBY_CHECK_PRINTF_PREFIX(int64_t, ll I64 l, 64) Index: win32/Makefile.sub =================================================================== --- win32/Makefile.sub (revision 65063) +++ win32/Makefile.sub (revision 65064) @@ -762,8 +762,10 @@ $(CONFIG_H): $(MKFILES) $(srcdir)/win32/ https://github.com/ruby/ruby/blob/trunk/win32/Makefile.sub#L762 #define HAVE_SSIZE_T 1 !if "$(ARCH)" == "x64" || "$(ARCH)" == "ia64" #define ssize_t __int64 +#define PRI_PTR_PREFIX "I64" !else #define ssize_t int +#define PRI_PTR_PREFIX PRI_INT_PREFIX !endif #define PRI_LL_PREFIX "I64" #define PRI_PIDT_PREFIX PRI_INT_PREFIX Index: include/ruby/ruby.h =================================================================== --- include/ruby/ruby.h (revision 65063) +++ include/ruby/ruby.h (revision 65064) @@ -139,6 +139,15 @@ typedef char ruby_check_sizeof_voidp[SIZ https://github.com/ruby/ruby/blob/trunk/include/ruby/ruby.h#L139 #endif #endif +#ifndef PRIdPTR +#define PRIdPTR PRI_PTR_PREFIX"d" +#define PRIiPTR PRI_PTR_PREFIX"i" +#define PRIoPTR PRI_PTR_PREFIX"o" +#define PRIuPTR PRI_PTR_PREFIX"u" +#define PRIxPTR PRI_PTR_PREFIX"x" +#define PRIXPTR PRI_PTR_PREFIX"X" +#endif + #define RUBY_PRI_VALUE_MARK "\v" #if defined PRIdPTR && !defined PRI_VALUE_PREFIX #define PRIdVALUE PRIdPTR -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/