From c38c2d8ee26c70300e2e0a4eec867273a8520579 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Wed, 28 Jul 2021 16:40:02 +0900 Subject: [PATCH] Moved exported symbols in internal/util.h to ruby/util.h [Feature #18051] --- bignum.c | 1 - common.mk | 11 ++++------- debug.c | 1 - include/ruby/util.h | 4 ++++ internal/util.h | 3 --- memory_view.c | 2 +- pack.c | 2 +- parse.y | 1 - sprintf.c | 2 +- strftime.c | 2 +- 10 files changed, 12 insertions(+), 17 deletions(-) diff --git a/bignum.c b/bignum.c index da5df41f97..c954fe6755 100644 --- a/bignum.c +++ b/bignum.c @@ -36,7 +36,6 @@ #include "internal/numeric.h" #include "internal/object.h" #include "internal/sanitizers.h" -#include "internal/util.h" #include "internal/variable.h" #include "internal/warnings.h" #include "ruby/thread.h" diff --git a/common.mk b/common.mk index 164d927970..f42d1b6805 100644 --- a/common.mk +++ b/common.mk @@ -2111,7 +2111,6 @@ bignum.$(OBJEXT): $(top_srcdir)/internal/object.h bignum.$(OBJEXT): $(top_srcdir)/internal/sanitizers.h bignum.$(OBJEXT): $(top_srcdir)/internal/serial.h bignum.$(OBJEXT): $(top_srcdir)/internal/static_assert.h -bignum.$(OBJEXT): $(top_srcdir)/internal/util.h bignum.$(OBJEXT): $(top_srcdir)/internal/variable.h bignum.$(OBJEXT): $(top_srcdir)/internal/vm.h bignum.$(OBJEXT): $(top_srcdir)/internal/warnings.h @@ -3436,7 +3435,6 @@ debug.$(OBJEXT): $(top_srcdir)/internal/imemo.h debug.$(OBJEXT): $(top_srcdir)/internal/serial.h debug.$(OBJEXT): $(top_srcdir)/internal/signal.h debug.$(OBJEXT): $(top_srcdir)/internal/static_assert.h -debug.$(OBJEXT): $(top_srcdir)/internal/util.h debug.$(OBJEXT): $(top_srcdir)/internal/vm.h debug.$(OBJEXT): $(top_srcdir)/internal/warnings.h debug.$(OBJEXT): {$(VPATH)}assert.h @@ -7881,7 +7879,6 @@ math.$(OBJEXT): {$(VPATH)}st.h math.$(OBJEXT): {$(VPATH)}subst.h memory_view.$(OBJEXT): $(hdrdir)/ruby/ruby.h memory_view.$(OBJEXT): $(top_srcdir)/internal/hash.h -memory_view.$(OBJEXT): $(top_srcdir)/internal/util.h memory_view.$(OBJEXT): $(top_srcdir)/internal/variable.h memory_view.$(OBJEXT): {$(VPATH)}assert.h memory_view.$(OBJEXT): {$(VPATH)}backward/2/assume.h @@ -8045,6 +8042,7 @@ memory_view.$(OBJEXT): {$(VPATH)}missing.h memory_view.$(OBJEXT): {$(VPATH)}node.h memory_view.$(OBJEXT): {$(VPATH)}st.h memory_view.$(OBJEXT): {$(VPATH)}subst.h +memory_view.$(OBJEXT): {$(VPATH)}util.h memory_view.$(OBJEXT): {$(VPATH)}vm_debug.h memory_view.$(OBJEXT): {$(VPATH)}vm_sync.h miniinit.$(OBJEXT): $(CCAN_DIR)/check_type/check_type.h @@ -9277,7 +9275,6 @@ pack.$(OBJEXT): $(top_srcdir)/internal/compilers.h pack.$(OBJEXT): $(top_srcdir)/internal/static_assert.h pack.$(OBJEXT): $(top_srcdir)/internal/string.h pack.$(OBJEXT): $(top_srcdir)/internal/symbol.h -pack.$(OBJEXT): $(top_srcdir)/internal/util.h pack.$(OBJEXT): $(top_srcdir)/internal/variable.h pack.$(OBJEXT): $(top_srcdir)/internal/warnings.h pack.$(OBJEXT): {$(VPATH)}assert.h @@ -9444,6 +9441,7 @@ pack.$(OBJEXT): {$(VPATH)}pack.c pack.$(OBJEXT): {$(VPATH)}pack.rbinc pack.$(OBJEXT): {$(VPATH)}st.h pack.$(OBJEXT): {$(VPATH)}subst.h +pack.$(OBJEXT): {$(VPATH)}util.h parse.$(OBJEXT): $(hdrdir)/ruby.h parse.$(OBJEXT): $(hdrdir)/ruby/ruby.h parse.$(OBJEXT): $(top_srcdir)/internal/array.h @@ -9467,7 +9465,6 @@ parse.$(OBJEXT): $(top_srcdir)/internal/static_assert.h parse.$(OBJEXT): $(top_srcdir)/internal/string.h parse.$(OBJEXT): $(top_srcdir)/internal/symbol.h parse.$(OBJEXT): $(top_srcdir)/internal/thread.h -parse.$(OBJEXT): $(top_srcdir)/internal/util.h parse.$(OBJEXT): $(top_srcdir)/internal/variable.h parse.$(OBJEXT): $(top_srcdir)/internal/vm.h parse.$(OBJEXT): $(top_srcdir)/internal/warnings.h @@ -12757,7 +12754,6 @@ sprintf.$(OBJEXT): $(top_srcdir)/internal/serial.h sprintf.$(OBJEXT): $(top_srcdir)/internal/static_assert.h sprintf.$(OBJEXT): $(top_srcdir)/internal/string.h sprintf.$(OBJEXT): $(top_srcdir)/internal/symbol.h -sprintf.$(OBJEXT): $(top_srcdir)/internal/util.h sprintf.$(OBJEXT): $(top_srcdir)/internal/vm.h sprintf.$(OBJEXT): $(top_srcdir)/internal/warnings.h sprintf.$(OBJEXT): {$(VPATH)}assert.h @@ -12925,6 +12921,7 @@ sprintf.$(OBJEXT): {$(VPATH)}regex.h sprintf.$(OBJEXT): {$(VPATH)}sprintf.c sprintf.$(OBJEXT): {$(VPATH)}st.h sprintf.$(OBJEXT): {$(VPATH)}subst.h +sprintf.$(OBJEXT): {$(VPATH)}util.h sprintf.$(OBJEXT): {$(VPATH)}vsnprintf.c st.$(OBJEXT): $(hdrdir)/ruby.h st.$(OBJEXT): $(hdrdir)/ruby/ruby.h @@ -13097,7 +13094,6 @@ strftime.$(OBJEXT): $(top_srcdir)/internal/compilers.h strftime.$(OBJEXT): $(top_srcdir)/internal/serial.h strftime.$(OBJEXT): $(top_srcdir)/internal/static_assert.h strftime.$(OBJEXT): $(top_srcdir)/internal/string.h -strftime.$(OBJEXT): $(top_srcdir)/internal/util.h strftime.$(OBJEXT): $(top_srcdir)/internal/vm.h strftime.$(OBJEXT): {$(VPATH)}assert.h strftime.$(OBJEXT): {$(VPATH)}backward/2/assume.h @@ -13260,6 +13256,7 @@ strftime.$(OBJEXT): {$(VPATH)}st.h strftime.$(OBJEXT): {$(VPATH)}strftime.c strftime.$(OBJEXT): {$(VPATH)}subst.h strftime.$(OBJEXT): {$(VPATH)}timev.h +strftime.$(OBJEXT): {$(VPATH)}util.h string.$(OBJEXT): $(hdrdir)/ruby.h string.$(OBJEXT): $(hdrdir)/ruby/ruby.h string.$(OBJEXT): $(top_srcdir)/internal/array.h diff --git a/debug.c b/debug.c index 75d4cc6569..3b4f1cbb12 100644 --- a/debug.c +++ b/debug.c @@ -16,7 +16,6 @@ #include "eval_intern.h" #include "id.h" #include "internal/signal.h" -#include "internal/util.h" #include "ruby/encoding.h" #include "ruby/io.h" #include "ruby/ruby.h" diff --git a/include/ruby/util.h b/include/ruby/util.h index af022dacbd..660f91de8e 100644 --- a/include/ruby/util.h +++ b/include/ruby/util.h @@ -19,6 +19,10 @@ RBIMPL_SYMBOL_EXPORT_BEGIN() #define DECIMAL_SIZE_OF_BITS(n) (((n) * 3010 + 9998) / 9999) /* an approximation of ceil(n * log10(2)), up to 65536 at least */ +RUBY_EXTERN const signed char ruby_digit36_to_number_table[]; +RUBY_EXTERN const char ruby_hexdigits[]; + +unsigned long ruby_scan_digits(const char *str, ssize_t len, int base, size_t *retlen, int *overflow); #define scan_oct(s,l,e) ((int)ruby_scan_oct((s),(l),(e))) unsigned long ruby_scan_oct(const char *, size_t, size_t *); #define scan_hex(s,l,e) ((int)ruby_scan_hex((s),(l),(e))) diff --git a/internal/util.h b/internal/util.h index c28b884d32..605720de10 100644 --- a/internal/util.h +++ b/internal/util.h @@ -23,9 +23,6 @@ char *ruby_hdtoa(double d, const char *xdigs, int ndigits, int *decpt, int *sign RUBY_SYMBOL_EXPORT_BEGIN /* util.c (export) */ -extern const signed char ruby_digit36_to_number_table[]; -extern const char ruby_hexdigits[]; -extern unsigned long ruby_scan_digits(const char *str, ssize_t len, int base, size_t *retlen, int *overflow); RUBY_SYMBOL_EXPORT_END #endif /* INTERNAL_UTIL_H */ diff --git a/memory_view.c b/memory_view.c index 6e422c1476..4c6c1225e8 100644 --- a/memory_view.c +++ b/memory_view.c @@ -9,8 +9,8 @@ #include "internal.h" #include "internal/hash.h" #include "internal/variable.h" -#include "internal/util.h" #include "ruby/memory_view.h" +#include "ruby/util.h" #include "vm_sync.h" #if SIZEOF_INTPTR_T == SIZEOF_LONG_LONG diff --git a/pack.c b/pack.c index 440346576b..280d45280d 100644 --- a/pack.c +++ b/pack.c @@ -21,8 +21,8 @@ #include "internal/bits.h" #include "internal/string.h" #include "internal/symbol.h" -#include "internal/util.h" #include "internal/variable.h" +#include "ruby/util.h" #include "builtin.h" diff --git a/parse.y b/parse.y index 65c90a7a68..2873d2fff3 100644 --- a/parse.y +++ b/parse.y @@ -42,7 +42,6 @@ struct lex_context; #include "internal/re.h" #include "internal/symbol.h" #include "internal/thread.h" -#include "internal/util.h" #include "internal/variable.h" #include "node.h" #include "probes.h" diff --git a/sprintf.c b/sprintf.c index 693b30bd8b..5237b8d2c8 100644 --- a/sprintf.c +++ b/sprintf.c @@ -28,9 +28,9 @@ #include "internal/object.h" #include "internal/sanitizers.h" #include "internal/symbol.h" -#include "internal/util.h" #include "ruby/encoding.h" #include "ruby/re.h" +#include "ruby/util.h" #define BIT_DIGITS(N) (((N)*146)/485 + 1) /* log2(10) =~ 146/485 */ diff --git a/strftime.c b/strftime.c index 17cfed1dda..4451fe3c6b 100644 --- a/strftime.c +++ b/strftime.c @@ -67,10 +67,10 @@ #include "internal.h" #include "internal/string.h" -#include "internal/util.h" #include "internal/vm.h" #include "ruby/encoding.h" #include "ruby/ruby.h" +#include "ruby/util.h" #include "timev.h" /* defaults: season to taste */