mirror of
https://github.com/ruby/ruby.git
synced 2025-09-21 03:24:00 +02:00
* configure.in (sizeof ptrdiff_t): check for size of ptrdiff_t.
* include/ruby/ruby.h (PRI?PTRDIFF, PRI?SIZE): printf conversion specifiers for ptrdiff_t and size_t/ssize_t. * insns.def (leave), marshal.c (long_toobig), transcode.c (str_transcode), vm_dump.c (control_frame_dump, stack_dump_each), (debug_print_register, debug_print_pre): t and z length modifiers are C99. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18038 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
2c0a3f226a
commit
f94f8f351e
7 changed files with 64 additions and 28 deletions
|
@ -87,28 +87,51 @@ typedef unsigned long VALUE;
|
|||
typedef unsigned long ID;
|
||||
# define SIGNED_VALUE long
|
||||
# define SIZEOF_VALUE SIZEOF_LONG
|
||||
# define PRIdVALUE "ld"
|
||||
# define PRIiVALUE "li"
|
||||
# define PRIoVALUE "lo"
|
||||
# define PRIuVALUE "lu"
|
||||
# define PRIxVALUE "lx"
|
||||
# define PRIXVALUE "lX"
|
||||
# define PRI_VALUE_PREFIX "l"
|
||||
#elif SIZEOF_LONG_LONG == SIZEOF_VOIDP
|
||||
typedef unsigned LONG_LONG VALUE;
|
||||
typedef unsigned LONG_LONG ID;
|
||||
# define SIGNED_VALUE LONG_LONG
|
||||
# define LONG_LONG_VALUE 1
|
||||
# define SIZEOF_VALUE SIZEOF_LONG_LONG
|
||||
# define PRIdVALUE "lld"
|
||||
# define PRIiVALUE "lli"
|
||||
# define PRIoVALUE "llo"
|
||||
# define PRIuVALUE "llu"
|
||||
# define PRIxVALUE "llx"
|
||||
# define PRIXVALUE "llX"
|
||||
# define PRI_VALUE_PREFIX "ll"
|
||||
#else
|
||||
# error ---->> ruby requires sizeof(void*) == sizeof(long) to be compiled. <<----
|
||||
#endif
|
||||
#define PRIdVALUE PRI_VALUE_PREFIX"d"
|
||||
#define PRIiVALUE PRI_VALUE_PREFIX"i"
|
||||
#define PRIoVALUE PRI_VALUE_PREFIX"o"
|
||||
#define PRIuVALUE PRI_VALUE_PREFIX"u"
|
||||
#define PRIxVALUE PRI_VALUE_PREFIX"x"
|
||||
#define PRIXVALUE PRI_VALUE_PREFIX"X"
|
||||
|
||||
#if SIZEOF_PTRDIFF_T == SIZEOF_INT
|
||||
# define PRI_PTDIFF_PREFIX
|
||||
#elif SIZEOF_PTRDIFF_T == SIZEOF_LONG
|
||||
# define PRI_PTDIFF_PREFIX "l"
|
||||
#elif SIZEOF_PTRDIFF_T == SIZEOF_LONG
|
||||
# define PRI_PTDIFF_PREFIX "ll"
|
||||
#endif
|
||||
#define PRIdPTRDIFF PRI_PTRDIFF_PREFIX"d"
|
||||
#define PRIiPTRDIFF PRI_PTRDIFF_PREFIX"i"
|
||||
#define PRIoPTRDIFF PRI_PTRDIFF_PREFIX"o"
|
||||
#define PRIuPTRDIFF PRI_PTRDIFF_PREFIX"u"
|
||||
#define PRIxPTRDIFF PRI_PTRDIFF_PREFIX"x"
|
||||
#define PRIXPTRDIFF PRI_PTRDIFF_PREFIX"X"
|
||||
|
||||
#if SIZEOF_SIZE_T == SIZEOF_INT
|
||||
# define PRI_PTDIFF_PREFIX
|
||||
#elif SIZEOF_SIZE_T == SIZEOF_LONG
|
||||
# define PRI_PTDIFF_PREFIX "l"
|
||||
#elif SIZEOF_SIZE_T == SIZEOF_LONG
|
||||
# define PRI_PTDIFF_PREFIX "ll"
|
||||
#endif
|
||||
#define PRIdSIZE PRI_SIZE_PREFIX"d"
|
||||
#define PRIiSIZE PRI_SIZE_PREFIX"i"
|
||||
#define PRIoSIZE PRI_SIZE_PREFIX"o"
|
||||
#define PRIuSIZE PRI_SIZE_PREFIX"u"
|
||||
#define PRIxSIZE PRI_SIZE_PREFIX"x"
|
||||
#define PRIXSIZE PRI_SIZE_PREFIX"X"
|
||||
|
||||
#ifdef __STDC__
|
||||
# include <limits.h>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue