summaryrefslogtreecommitdiff
path: root/ext/bigdecimal/bigdecimal.h
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-02-04 07:32:58 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-02-04 07:32:58 +0000
commita44f7a3ee672352781c614e46b91f6212321d561 (patch)
treed4c15e112bbef9947c2a1f6d00aaa6830e4fbcc6 /ext/bigdecimal/bigdecimal.h
parent718b42530626167829d7799efd7819d626c833ca (diff)
bigdecimal.c: format specifiers
* ext/bigdecimal/bigdecimal.c (VpInit, VpPower, VpVarCheck): fix format specifiers of BDIGIT. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49492 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/bigdecimal/bigdecimal.h')
-rw-r--r--ext/bigdecimal/bigdecimal.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/ext/bigdecimal/bigdecimal.h b/ext/bigdecimal/bigdecimal.h
index 9d3e0fc..570ca81 100644
--- a/ext/bigdecimal/bigdecimal.h
+++ b/ext/bigdecimal/bigdecimal.h
@@ -43,13 +43,35 @@
# define BDIGIT_DBL uint64_t
# define BDIGIT_DBL_SIGNED int64_t
# define SIZEOF_BDIGITS 4
+# define PRI_BDIGIT_PREFIX ""
+# ifdef PRI_LL_PREFIX
+# define PRI_BDIGIT_DBL_PREFIX PRI_LL_PREFIX
+# else
+# define PRI_BDIGIT_DBL_PREFIX "l"
+# endif
#else
# define BDIGIT uint16_t
# define BDIGIT_DBL uint32_t
# define BDIGIT_DBL_SIGNED int32_t
# define SIZEOF_BDIGITS 2
+# define PRI_BDIGIT_PREFIX "h"
+# define PRI_BDIGIT_DBL_PREFIX ""
#endif
+#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"
+
+#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"
+
#if defined(__cplusplus)
extern "C" {
#if 0