1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Define PRIdPTR etc

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65064 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2018-10-13 16:21:07 +00:00
parent 262437b457
commit f2427a436f
3 changed files with 14 additions and 0 deletions

View file

@ -1596,6 +1596,9 @@ RUBY_DEFINT(int128_t, 16)
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)

View file

@ -139,6 +139,15 @@ typedef char ruby_check_sizeof_voidp[SIZEOF_VOIDP == sizeof(void*) ? 1 : -1];
#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

View file

@ -762,8 +762,10 @@ $(CONFIG_H): $(MKFILES) $(srcdir)/win32/Makefile.sub $(win_srcdir)/Makefile.sub
#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