mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
remove dependency to SIZEOF_INT
This commit is contained in:
@@ -22,7 +22,6 @@ typedef intptr_t mrb_sym;
|
||||
#undef HAVE_UNISTD_H /* WINDOWS */
|
||||
#define HAVE_UNISTD_H /* LINUX */
|
||||
|
||||
#define SIZEOF_INT 4
|
||||
#define SIZEOF_SHORT 2
|
||||
#define SIZEOF_LONG 4
|
||||
#define SIZEOF_LONG_LONG 8
|
||||
|
||||
@@ -560,60 +560,6 @@ void mrb_check_type(mrb_state *mrb, mrb_value x, enum mrb_vtype t);
|
||||
#define ruby_setjmp(env) RUBY_SETJMP(env)
|
||||
#define ruby_longjmp(env,val) RUBY_LONGJMP(env,val)
|
||||
|
||||
#if defined PRIdPTR && !defined PRI_VALUE_PREFIX
|
||||
#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
|
||||
#ifndef PRI_VALUE_PREFIX
|
||||
# define PRI_VALUE_PREFIX ""
|
||||
#endif
|
||||
|
||||
#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"
|
||||
#elif SIZEOF_PTRDIFF_T == SIZEOF_LONG_LONG
|
||||
# define PRI_PTRDIFF_PREFIX "ll"
|
||||
#else
|
||||
# define PRI_PTRDIFF_PREFIX
|
||||
#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 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"
|
||||
#elif SIZEOF_SIZE_T == SIZEOF_LONG_LONG
|
||||
# define PRI_SIZE_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"
|
||||
#define PRIdPTRDIFF PRI_PTRDIFF_PREFIX"d"
|
||||
|
||||
#define KHASH 0
|
||||
#define STHASH 1
|
||||
#define BASICHASH 2
|
||||
|
||||
Reference in New Issue
Block a user