diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-11-11 11:49:54 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-11-11 11:49:54 +0000 |
commit | fe9f1e8cf8a1d49c7d4d6baff2f1797ff89e7956 (patch) | |
tree | 81fe28f3a9a4ba55599c1c929e5e0b8d6967f1c2 /include | |
parent | 8a7d063c1f46fb47d12119e6c2b6dcbfcbc1d909 (diff) | |
download | ruby-fe9f1e8cf8a1d49c7d4d6baff2f1797ff89e7956.tar.gz |
* include/ruby/ruby.h (PRI_LL_PREFIX): format type specifier for
LONG_LONG may vary on platforms.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29741 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'include')
-rw-r--r-- | include/ruby/ruby.h | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/include/ruby/ruby.h b/include/ruby/ruby.h index 3dc61e2738..02ff3c5127 100644 --- a/include/ruby/ruby.h +++ b/include/ruby/ruby.h @@ -101,7 +101,7 @@ typedef unsigned LONG_LONG ID; # define SIGNED_VALUE LONG_LONG # define LONG_LONG_VALUE 1 # define SIZEOF_VALUE SIZEOF_LONG_LONG -# define PRI_VALUE_PREFIX "ll" +# define PRI_VALUE_PREFIX PRI_LL_PREFIX #else # error ---->> ruby requires sizeof(void*) == sizeof(long) to be compiled. <<---- #endif @@ -113,6 +113,13 @@ typedef char ruby_check_sizeof_long_long[SIZEOF_LONG_LONG == sizeof(LONG_LONG) ? #endif typedef char ruby_check_sizeof_voidp[SIZEOF_VOIDP == sizeof(void*) ? 1 : -1]; +#ifndef PRI_INT_PREFIX +#define PRI_INT_PREFIX "" +#endif +#ifndef PRI_LONG_PREFIX +#define PRI_LONG_PREFIX "l" +#endif + #if defined PRIdPTR && !defined PRI_VALUE_PREFIX #define PRIdVALUE PRIdPTR #define PRIiVALUE PRIiPTR @@ -138,19 +145,17 @@ typedef char ruby_check_sizeof_voidp[SIZEOF_VOIDP == sizeof(void*) ? 1 : -1]; # elif SIZEOF_TIME_T == SIZEOF_LONG # define PRI_TIMET_PREFIX "l" # elif SIZEOF_TIME_T == SIZEOF_LONG_LONG -# define PRI_TIMET_PREFIX "ll" +# define PRI_TIMET_PREFIX PRI_LL_PREFIX # endif #endif #if defined PRI_PTRDIFF_PREFIX -#elif defined PRIdPTR -# define PRI_PTRDIFF_PREFIX "t" #elif SIZEOF_PTRDIFF_T == SIZEOF_INT -# define PRI_PTRDIFF_PREFIX +# 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" +# define PRI_PTRDIFF_PREFIX PRI_LL_PREFIX #endif #define PRIdPTRDIFF PRI_PTRDIFF_PREFIX"d" #define PRIiPTRDIFF PRI_PTRDIFF_PREFIX"i" @@ -160,14 +165,12 @@ typedef char ruby_check_sizeof_voidp[SIZEOF_VOIDP == sizeof(void*) ? 1 : -1]; #define PRIXPTRDIFF PRI_PTRDIFF_PREFIX"X" #if defined PRI_SIZE_PREFIX -#elif defined PRIdPTR -# define PRI_SIZE_PREFIX "z" #elif SIZEOF_SIZE_T == SIZEOF_INT -# define PRI_SIZE_PREFIX +# 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" +# define PRI_SIZE_PREFIX PRI_LL_PREFIX #endif #define PRIdSIZE PRI_SIZE_PREFIX"d" #define PRIiSIZE PRI_SIZE_PREFIX"i" |