From 66a844fd07ca0fd652a20a1973ea242422d4ae6d Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Mon, 11 Jan 2021 19:12:16 +0900 Subject: Define printf qualifier prefix fallbacks --- include/ruby/internal/arithmetic/gid_t.h | 4 ++++ include/ruby/internal/arithmetic/mode_t.h | 4 ++++ include/ruby/internal/arithmetic/off_t.h | 10 ++++++++++ include/ruby/internal/arithmetic/pid_t.h | 4 ++++ include/ruby/internal/arithmetic/uid_t.h | 4 ++++ 5 files changed, 26 insertions(+) (limited to 'include') diff --git a/include/ruby/internal/arithmetic/gid_t.h b/include/ruby/internal/arithmetic/gid_t.h index 32e3578bd2..094fc63092 100644 --- a/include/ruby/internal/arithmetic/gid_t.h +++ b/include/ruby/internal/arithmetic/gid_t.h @@ -31,4 +31,8 @@ # define NUM2GIDT RB_NUM2LONG #endif +#ifndef PRI_GIDT_PREFIX +# define PRI_GIDT_PREFIX PRI_LONG_PREFIX +#endif + #endif /* RBIMPL_ARITHMETIC_GID_T_H */ diff --git a/include/ruby/internal/arithmetic/mode_t.h b/include/ruby/internal/arithmetic/mode_t.h index ee47eb8221..46e41f7ef9 100644 --- a/include/ruby/internal/arithmetic/mode_t.h +++ b/include/ruby/internal/arithmetic/mode_t.h @@ -31,4 +31,8 @@ # define MODET2NUM RB_INT2NUM #endif +#ifndef PRI_MODET_PREFIX +# define PRI_MODET_PREFIX PRI_INT_PREFIX +#endif + #endif /* RBIMPL_ARITHMETIC_MODE_T_H */ diff --git a/include/ruby/internal/arithmetic/off_t.h b/include/ruby/internal/arithmetic/off_t.h index 84ec807e3d..c1959c61a1 100644 --- a/include/ruby/internal/arithmetic/off_t.h +++ b/include/ruby/internal/arithmetic/off_t.h @@ -46,4 +46,14 @@ # define NUM2OFFT RB_NUM2INT #endif +#ifdef PRI_OFFT_PREFIX +# /* take that. */ +#elif SIZEOF_OFF_T == SIZEOF_LONG_LONG +# define PRI_OFFT_PREFIX PRI_LL_PREFIX +#elif SIZEOF_OFF_T == SIZEOF_LONG +# define PRI_OFFT_PREFIX PRI_LONG_PREFIX +#else +# define PRI_OFFT_PREFIX PRI_INT_PREFIX +#endif + #endif /* RBIMPL_ARITHMETIC_OFF_T_H */ diff --git a/include/ruby/internal/arithmetic/pid_t.h b/include/ruby/internal/arithmetic/pid_t.h index eaca402776..86373ebfde 100644 --- a/include/ruby/internal/arithmetic/pid_t.h +++ b/include/ruby/internal/arithmetic/pid_t.h @@ -31,4 +31,8 @@ # define NUM2PIDT RB_NUM2LONG #endif +#ifndef PRI_PIDT_PREFIX +# define PRI_PIDT_PREFIX PRI_LONG_PREFIX +#endif + #endif /* RBIMPL_ARITHMETIC_PID_T_H */ diff --git a/include/ruby/internal/arithmetic/uid_t.h b/include/ruby/internal/arithmetic/uid_t.h index bdcf42f049..a990b2f480 100644 --- a/include/ruby/internal/arithmetic/uid_t.h +++ b/include/ruby/internal/arithmetic/uid_t.h @@ -31,4 +31,8 @@ # define NUM2UIDT RB_NUM2LONG #endif +#ifndef PRI_UIDT_PREFIX +# define PRI_UIDT_PREFIX PRI_LONG_PREFIX +#endif + #endif /* RBIMPL_ARITHMETIC_UID_T_H */ -- cgit v1.2.3