* configure.in (RUBY_REPLACE_TYPE): does not define rb_ prefixed

name if no default type is given.

* configure.in (RUBY_DEFINT): checks size.

* include/ruby/ruby.h (VALUE): use uintptr_t if available.

* include/ruby/ruby.h (PRI_PTRDIFF_PREFIX, PRI_SIZE_PREFIX):
  assumes usable if PRIdPTR is defined.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21587 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2009-01-16 02:41:26 +00:00
parent 3e7c34140c
commit 5b6a192755
3 changed files with 67 additions and 14 deletions

View file

@ -60,6 +60,9 @@ extern "C" {
# include <intrinsics.h>
#endif
#ifdef HAVE_STDINT_H
# include <stdint.h>
#endif
#ifdef HAVE_INTTYPES_H
# include <inttypes.h>
#endif
@ -77,7 +80,13 @@ extern "C" {
# endif
#endif
#if SIZEOF_LONG == SIZEOF_VOIDP
#if defined HAVE_UINTPTR_T
typedef uintptr_t VALUE;
typedef uintptr_t ID;
# define SIGNED_VALUE intptr_t
# define SIZEOF_VALUE SIZEOF_UINTPTR_T
# undef PRI_VALUE_PREFIX
#elif SIZEOF_LONG == SIZEOF_VOIDP
typedef unsigned long VALUE;
typedef unsigned long ID;
# define SIGNED_VALUE long
@ -93,14 +102,26 @@ typedef unsigned LONG_LONG ID;
#else
# error ---->> ruby requires sizeof(void*) == sizeof(long) to be compiled. <<----
#endif
#ifdef PRIdPTR
#define PRIdVALUE PRIdPTR
#define PRIiVALUE PRIiPTR
#define PRIoVALUE PRIoPTR
#define PRIuVALUE PRIuPTR
#define PRIxVALUE PRIxPTR
#define PRIXVALUE PRIXPTR
#else
#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"
#endif
#if SIZEOF_PTRDIFF_T == SIZEOF_INT
#if defined PRIdPTR
# define PRI_PTRDIFF_PREFIX "t"
#elif SIZEOF_PTRDIFF_T == SIZEOF_INT
# define PRI_PTRDIFF_PREFIX
#elif SIZEOF_PTRDIFF_T == SIZEOF_LONG
# define PRI_PTRDIFF_PREFIX "l"
@ -114,7 +135,9 @@ typedef unsigned LONG_LONG ID;
#define PRIxPTRDIFF PRI_PTRDIFF_PREFIX"x"
#define PRIXPTRDIFF PRI_PTRDIFF_PREFIX"X"
#if SIZEOF_SIZE_T == SIZEOF_INT
#if defined PRIdPTR
# define PRI_SIZE_PREFIX "z"
#elif SIZEOF_SIZE_T == SIZEOF_INT
# define PRI_SIZE_PREFIX
#elif SIZEOF_SIZE_T == SIZEOF_LONG
# define PRI_SIZE_PREFIX "l"