ruby-changes:32948
From: akr <ko1@a...>
Date: Mon, 17 Feb 2014 20:01:17 +0900 (JST)
Subject: [ruby-changes:32948] akr:r45027 (trunk): * internal.h: Move BDIGIT and related definitions from
akr 2014-02-17 20:01:12 +0900 (Mon, 17 Feb 2014) New Revision: 45027 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=45027 Log: * internal.h: Move BDIGIT and related definitions from include/ruby/defines.h. Modified files: trunk/ChangeLog trunk/include/ruby/defines.h trunk/internal.h Index: include/ruby/defines.h =================================================================== --- include/ruby/defines.h (revision 45026) +++ include/ruby/defines.h (revision 45027) @@ -143,60 +143,6 @@ void xfree(void*); https://github.com/ruby/ruby/blob/trunk/include/ruby/defines.h#L143 # define SIZEOF_LONG_LONG SIZEOF___INT64 #endif -#ifndef BDIGIT -# if SIZEOF_INT*2 <= SIZEOF_LONG_LONG -# define BDIGIT unsigned int -# define SIZEOF_BDIGITS SIZEOF_INT -# define BDIGIT_DBL unsigned LONG_LONG -# define BDIGIT_DBL_SIGNED LONG_LONG -# define PRI_BDIGIT_PREFIX "" -# define PRI_BDIGIT_DBL_PREFIX PRI_LL_PREFIX -# elif SIZEOF_INT*2 <= SIZEOF_LONG -# define BDIGIT unsigned int -# define SIZEOF_BDIGITS SIZEOF_INT -# define BDIGIT_DBL unsigned long -# define BDIGIT_DBL_SIGNED long -# define PRI_BDIGIT_PREFIX "" -# define PRI_BDIGIT_DBL_PREFIX "l" -# elif SIZEOF_SHORT*2 <= SIZEOF_LONG -# define BDIGIT unsigned short -# define SIZEOF_BDIGITS SIZEOF_SHORT -# define BDIGIT_DBL unsigned long -# define BDIGIT_DBL_SIGNED long -# define PRI_BDIGIT_PREFIX "h" -# define PRI_BDIGIT_DBL_PREFIX "l" -# else -# define BDIGIT unsigned short -# define SIZEOF_BDIGITS (SIZEOF_LONG/2) -# define SIZEOF_ACTUAL_BDIGIT SIZEOF_LONG -# define BDIGIT_DBL unsigned long -# define BDIGIT_DBL_SIGNED long -# define PRI_BDIGIT_PREFIX "h" -# define PRI_BDIGIT_DBL_PREFIX "l" -# endif -#endif -#ifndef SIZEOF_ACTUAL_BDIGIT -# define SIZEOF_ACTUAL_BDIGIT SIZEOF_BDIGITS -#endif - -#ifdef PRI_BDIGIT_PREFIX -# define PRIdBDIGIT PRI_BDIGIT_PREFIX"d" -# define PRIiBDIGIT PRI_BDIGIT_PREFIX"i" -# define PRIoBDIGIT PRI_BDIGIT_PREFIX"o" -# define PRIuBDIGIT PRI_BDIGIT_PREFIX"u" -# define PRIxBDIGIT PRI_BDIGIT_PREFIX"x" -# define PRIXBDIGIT PRI_BDIGIT_PREFIX"X" -#endif - -#ifdef PRI_BDIGIT_DBL_PREFIX -# define PRIdBDIGIT_DBL PRI_BDIGIT_DBL_PREFIX"d" -# define PRIiBDIGIT_DBL PRI_BDIGIT_DBL_PREFIX"i" -# define PRIoBDIGIT_DBL PRI_BDIGIT_DBL_PREFIX"o" -# define PRIuBDIGIT_DBL PRI_BDIGIT_DBL_PREFIX"u" -# define PRIxBDIGIT_DBL PRI_BDIGIT_DBL_PREFIX"x" -# define PRIXBDIGIT_DBL PRI_BDIGIT_DBL_PREFIX"X" -#endif - #ifdef __CYGWIN__ #undef _WIN32 #endif Index: ChangeLog =================================================================== --- ChangeLog (revision 45026) +++ ChangeLog (revision 45027) @@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Mon Feb 17 20:00:27 2014 Tanaka Akira <akr@f...> + + * internal.h: Move BDIGIT and related definitions from + include/ruby/defines.h. + Mon Feb 17 17:41:55 2014 Nobuyoshi Nakada <nobu@r...> * marshal.c (marshal_dump, marshal_load): do not recycle wrapper Index: internal.h =================================================================== --- internal.h (revision 45026) +++ internal.h (revision 45027) @@ -305,6 +305,60 @@ struct method_table_wrapper { https://github.com/ruby/ruby/blob/trunk/internal.h#L305 size_t serial; }; +#ifndef BDIGIT +# if SIZEOF_INT*2 <= SIZEOF_LONG_LONG +# define BDIGIT unsigned int +# define SIZEOF_BDIGITS SIZEOF_INT +# define BDIGIT_DBL unsigned LONG_LONG +# define BDIGIT_DBL_SIGNED LONG_LONG +# define PRI_BDIGIT_PREFIX "" +# define PRI_BDIGIT_DBL_PREFIX PRI_LL_PREFIX +# elif SIZEOF_INT*2 <= SIZEOF_LONG +# define BDIGIT unsigned int +# define SIZEOF_BDIGITS SIZEOF_INT +# define BDIGIT_DBL unsigned long +# define BDIGIT_DBL_SIGNED long +# define PRI_BDIGIT_PREFIX "" +# define PRI_BDIGIT_DBL_PREFIX "l" +# elif SIZEOF_SHORT*2 <= SIZEOF_LONG +# define BDIGIT unsigned short +# define SIZEOF_BDIGITS SIZEOF_SHORT +# define BDIGIT_DBL unsigned long +# define BDIGIT_DBL_SIGNED long +# define PRI_BDIGIT_PREFIX "h" +# define PRI_BDIGIT_DBL_PREFIX "l" +# else +# define BDIGIT unsigned short +# define SIZEOF_BDIGITS (SIZEOF_LONG/2) +# define SIZEOF_ACTUAL_BDIGIT SIZEOF_LONG +# define BDIGIT_DBL unsigned long +# define BDIGIT_DBL_SIGNED long +# define PRI_BDIGIT_PREFIX "h" +# define PRI_BDIGIT_DBL_PREFIX "l" +# endif +#endif +#ifndef SIZEOF_ACTUAL_BDIGIT +# define SIZEOF_ACTUAL_BDIGIT SIZEOF_BDIGITS +#endif + +#ifdef PRI_BDIGIT_PREFIX +# define PRIdBDIGIT PRI_BDIGIT_PREFIX"d" +# define PRIiBDIGIT PRI_BDIGIT_PREFIX"i" +# define PRIoBDIGIT PRI_BDIGIT_PREFIX"o" +# define PRIuBDIGIT PRI_BDIGIT_PREFIX"u" +# define PRIxBDIGIT PRI_BDIGIT_PREFIX"x" +# define PRIXBDIGIT PRI_BDIGIT_PREFIX"X" +#endif + +#ifdef PRI_BDIGIT_DBL_PREFIX +# define PRIdBDIGIT_DBL PRI_BDIGIT_DBL_PREFIX"d" +# define PRIiBDIGIT_DBL PRI_BDIGIT_DBL_PREFIX"i" +# define PRIoBDIGIT_DBL PRI_BDIGIT_DBL_PREFIX"o" +# define PRIuBDIGIT_DBL PRI_BDIGIT_DBL_PREFIX"u" +# define PRIxBDIGIT_DBL PRI_BDIGIT_DBL_PREFIX"x" +# define PRIXBDIGIT_DBL PRI_BDIGIT_DBL_PREFIX"X" +#endif + #define BIGNUM_EMBED_LEN_NUMBITS 3 #ifndef BIGNUM_EMBED_LEN_MAX # if (SIZEOF_VALUE*3/SIZEOF_ACTUAL_BDIGIT) < (1 << BIGNUM_EMBED_LEN_NUMBITS)-1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/