From e9cb552ec960d96f9f7b481d67b84b56fd1c4f5f Mon Sep 17 00:00:00 2001 From: nobu Date: Tue, 9 Jan 2018 06:24:11 +0000 Subject: internal.h: remove dependecy on ruby/encoding.h git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61713 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- array.c | 3 ++- compile.c | 4 +++- dir.c | 3 ++- encoding.c | 1 + enum.c | 1 + error.c | 3 ++- ext/-test-/string/cstr.c | 1 + file.c | 3 ++- gc.c | 1 + hash.c | 3 ++- internal.h | 19 ++++++++++++++----- io.c | 3 ++- load.c | 3 ++- localeinit.c | 1 + numeric.c | 3 ++- object.c | 3 ++- pack.c | 1 + re.c | 3 ++- ruby.c | 3 ++- sprintf.c | 3 ++- string.c | 3 ++- symbol.c | 3 ++- time.c | 1 + transcode.c | 1 + variable.c | 3 ++- vm.c | 1 + vm_backtrace.c | 3 ++- vm_core.h | 1 - 28 files changed, 58 insertions(+), 23 deletions(-) diff --git a/array.c b/array.c index fa88f47ae9..8a3ec0c8c1 100644 --- a/array.c +++ b/array.c @@ -11,9 +11,10 @@ **********************************************************************/ -#include "internal.h" +#include "ruby/encoding.h" #include "ruby/util.h" #include "ruby/st.h" +#include "internal.h" #include "probes.h" #include "id.h" #include "debug_counter.h" diff --git a/compile.c b/compile.c index 6d9d0f4180..64f88c4bc2 100644 --- a/compile.c +++ b/compile.c @@ -9,13 +9,15 @@ **********************************************************************/ -#include "internal.h" +#include "ruby/encoding.h" #include "ruby/re.h" +#include "internal.h" #include "encindex.h" #include #define USE_INSN_STACK_INCREASE 1 #include "vm_core.h" +#include "vm_debug.h" #include "iseq.h" #include "insns.inc" #include "insns_info.inc" diff --git a/dir.c b/dir.c index 7d4dc8781f..ecc2eeb8ad 100644 --- a/dir.c +++ b/dir.c @@ -11,9 +11,10 @@ **********************************************************************/ +#include "ruby/encoding.h" +#include "ruby/thread.h" #include "internal.h" #include "encindex.h" -#include "ruby/thread.h" #include #include diff --git a/encoding.c b/encoding.c index 2043a69598..f2f34406b5 100644 --- a/encoding.c +++ b/encoding.c @@ -9,6 +9,7 @@ **********************************************************************/ +#include "ruby/encoding.h" #include "internal.h" #include "encindex.h" #include "regenc.h" diff --git a/enum.c b/enum.c index ad34004081..9f74e77e88 100644 --- a/enum.c +++ b/enum.c @@ -9,6 +9,7 @@ **********************************************************************/ +#include "ruby/encoding.h" #include "internal.h" #include "ruby/util.h" #include "id.h" diff --git a/error.c b/error.c index aba99c9840..43ad798744 100644 --- a/error.c +++ b/error.c @@ -9,8 +9,9 @@ **********************************************************************/ -#include "internal.h" +#include "ruby/encoding.h" #include "ruby/st.h" +#include "internal.h" #include "ruby_assert.h" #include "vm_core.h" diff --git a/ext/-test-/string/cstr.c b/ext/-test-/string/cstr.c index 2a41b932db..71eafdb703 100644 --- a/ext/-test-/string/cstr.c +++ b/ext/-test-/string/cstr.c @@ -1,3 +1,4 @@ +#include "ruby/encoding.h" #include "internal.h" static VALUE diff --git a/file.c b/file.c index 54d8fb1812..91df3c34c6 100644 --- a/file.c +++ b/file.c @@ -24,10 +24,11 @@ #endif #include "id.h" -#include "internal.h" +#include "ruby/encoding.h" #include "ruby/io.h" #include "ruby/util.h" #include "ruby/thread.h" +#include "internal.h" #include "dln.h" #include "encindex.h" diff --git a/gc.c b/gc.c index d0144f5266..b3edd4c54b 100644 --- a/gc.c +++ b/gc.c @@ -14,6 +14,7 @@ #define rb_data_object_alloc rb_data_object_alloc #define rb_data_typed_object_alloc rb_data_typed_object_alloc +#include "ruby/encoding.h" #include "ruby/io.h" #include "ruby/st.h" #include "ruby/re.h" diff --git a/hash.c b/hash.c index b4e86bdfb1..c36b865869 100644 --- a/hash.c +++ b/hash.c @@ -11,9 +11,10 @@ **********************************************************************/ -#include "internal.h" +#include "ruby/encoding.h" #include "ruby/st.h" #include "ruby/util.h" +#include "internal.h" #include #include "probes.h" #include "id.h" diff --git a/internal.h b/internal.h index 1a965991d3..b83999464c 100644 --- a/internal.h +++ b/internal.h @@ -13,7 +13,6 @@ #define RUBY_INTERNAL_H 1 #include "ruby.h" -#include "ruby/encoding.h" #if defined(__cplusplus) extern "C" { @@ -1149,8 +1148,10 @@ void Init_ext(void); /* encoding.c */ ID rb_id_encoding(void); void rb_gc_mark_encodings(void); +#ifdef RUBY_ENCODING_H rb_encoding *rb_enc_get_from_index(int index); rb_encoding *rb_enc_check_str(VALUE str1, VALUE str2); +#endif int rb_encdb_replicate(const char *alias, const char *orig); int rb_encdb_alias(const char *alias, const char *orig); int rb_encdb_dummy(const char *name); @@ -1169,21 +1170,23 @@ extern VALUE rb_eEAGAIN; extern VALUE rb_eEWOULDBLOCK; extern VALUE rb_eEINPROGRESS; void rb_report_bug_valist(VALUE file, int line, const char *fmt, va_list args); -VALUE rb_syntax_error_append(VALUE, VALUE, int, int, rb_encoding*, const char*, va_list); VALUE rb_check_backtrace(VALUE); NORETURN(void rb_async_bug_errno(const char *,int)); const char *rb_builtin_type_name(int t); const char *rb_builtin_class_name(VALUE x); PRINTF_ARGS(void rb_sys_warn(const char *fmt, ...), 1, 2); PRINTF_ARGS(void rb_syserr_warn(int err, const char *fmt, ...), 2, 3); +PRINTF_ARGS(void rb_sys_warning(const char *fmt, ...), 1, 2); +PRINTF_ARGS(void rb_syserr_warning(int err, const char *fmt, ...), 2, 3); +#ifdef RUBY_ENCODING_H +VALUE rb_syntax_error_append(VALUE, VALUE, int, int, rb_encoding*, const char*, va_list); PRINTF_ARGS(void rb_enc_warn(rb_encoding *enc, const char *fmt, ...), 2, 3); PRINTF_ARGS(void rb_sys_enc_warn(rb_encoding *enc, const char *fmt, ...), 2, 3); PRINTF_ARGS(void rb_syserr_enc_warn(int err, rb_encoding *enc, const char *fmt, ...), 3, 4); -PRINTF_ARGS(void rb_sys_warning(const char *fmt, ...), 1, 2); -PRINTF_ARGS(void rb_syserr_warning(int err, const char *fmt, ...), 2, 3); PRINTF_ARGS(void rb_enc_warning(rb_encoding *enc, const char *fmt, ...), 2, 3); PRINTF_ARGS(void rb_sys_enc_warning(rb_encoding *enc, const char *fmt, ...), 2, 3); PRINTF_ARGS(void rb_syserr_enc_warning(int err, rb_encoding *enc, const char *fmt, ...), 3, 4); +#endif #define rb_raise_cstr(etype, mesg) \ rb_exc_raise(rb_exc_new_str(etype, rb_str_new_cstr(mesg))) @@ -1801,17 +1804,23 @@ int rb_divert_reserved_fd(int fd); /* transcode.c */ extern VALUE rb_cEncodingConverter; +#ifdef RUBY_ENCODING_H size_t rb_econv_memsize(rb_econv_t *); +#endif /* us_ascii.c */ +#ifdef RUBY_ENCODING_H extern rb_encoding OnigEncodingUS_ASCII; +#endif /* util.c */ char *ruby_dtoa(double d_, int mode, int ndigits, int *decpt, int *sign, char **rve); char *ruby_hdtoa(double d, const char *xdigs, int ndigits, int *decpt, int *sign, char **rve); /* utf_8.c */ +#ifdef RUBY_ENCODING_H extern rb_encoding OnigEncodingUTF_8; +#endif /* variable.c */ void rb_gc_mark_global_tbl(void); @@ -1932,7 +1941,7 @@ NORETURN(void rb_unexpected_type(VALUE,int)); rb_unexpected_type((VALUE)(v), (t)) : (void)0) /* file.c (export) */ -#ifdef HAVE_READLINK +#if defined HAVE_READLINK && defined RUBY_ENCODING_H VALUE rb_readlink(VALUE path, rb_encoding *enc); #endif #ifdef __APPLE__ diff --git a/io.c b/io.c index eeaf0c021c..fd4892fab3 100644 --- a/io.c +++ b/io.c @@ -11,9 +11,10 @@ **********************************************************************/ -#include "internal.h" +#include "ruby/encoding.h" #include "ruby/io.h" #include "ruby/thread.h" +#include "internal.h" #include "dln.h" #include "encindex.h" #include "id.h" diff --git a/load.c b/load.c index e2a7a98522..5034691cc2 100644 --- a/load.c +++ b/load.c @@ -2,8 +2,9 @@ * load methods from eval.c */ -#include "internal.h" +#include "ruby/encoding.h" #include "ruby/util.h" +#include "internal.h" #include "dln.h" #include "eval_intern.h" #include "probes.h" diff --git a/localeinit.c b/localeinit.c index dc48d42561..bec29a6d46 100644 --- a/localeinit.c +++ b/localeinit.c @@ -9,6 +9,7 @@ **********************************************************************/ +#include "ruby/encoding.h" #include "internal.h" #include "encindex.h" #ifdef __CYGWIN__ diff --git a/numeric.c b/numeric.c index 918b46e9d3..4776b2485d 100644 --- a/numeric.c +++ b/numeric.c @@ -9,8 +9,9 @@ **********************************************************************/ -#include "internal.h" +#include "ruby/encoding.h" #include "ruby/util.h" +#include "internal.h" #include "id.h" #include #include diff --git a/object.c b/object.c index adec3f5e76..48c97b6f36 100644 --- a/object.c +++ b/object.c @@ -11,9 +11,10 @@ **********************************************************************/ -#include "internal.h" +#include "ruby/encoding.h" #include "ruby/st.h" #include "ruby/util.h" +#include "internal.h" #include #include #include diff --git a/pack.c b/pack.c index 45b816a590..3f2955e4cc 100644 --- a/pack.c +++ b/pack.c @@ -9,6 +9,7 @@ **********************************************************************/ +#include "ruby/encoding.h" #include "internal.h" #include #include diff --git a/re.c b/re.c index 1ed2f94c34..cef758614d 100644 --- a/re.c +++ b/re.c @@ -9,9 +9,10 @@ **********************************************************************/ -#include "internal.h" +#include "ruby/encoding.h" #include "ruby/re.h" #include "ruby/util.h" +#include "internal.h" #include "regint.h" #include "encindex.h" #include diff --git a/ruby.c b/ruby.c index 7e58ecb510..16be70e942 100644 --- a/ruby.c +++ b/ruby.c @@ -15,8 +15,9 @@ #include #include #endif -#include "internal.h" +#include "ruby/encoding.h" #include "ruby/thread.h" +#include "internal.h" #include "eval_intern.h" #include "dln.h" #include diff --git a/sprintf.c b/sprintf.c index a956381cd4..71802a4907 100644 --- a/sprintf.c +++ b/sprintf.c @@ -11,8 +11,9 @@ **********************************************************************/ -#include "internal.h" +#include "ruby/encoding.h" #include "ruby/re.h" +#include "internal.h" #include "id.h" #include #include diff --git a/string.c b/string.c index 390a9c3a58..582f58f485 100644 --- a/string.c +++ b/string.c @@ -11,8 +11,9 @@ **********************************************************************/ -#include "internal.h" +#include "ruby/encoding.h" #include "ruby/re.h" +#include "internal.h" #include "encindex.h" #include "probes.h" #include "gc.h" diff --git a/symbol.c b/symbol.c index 147c11f007..723764c34e 100644 --- a/symbol.c +++ b/symbol.c @@ -9,8 +9,9 @@ **********************************************************************/ -#include "internal.h" +#include "ruby/encoding.h" #include "ruby/st.h" +#include "internal.h" #include "symbol.h" #include "gc.h" #include "probes.h" diff --git a/time.c b/time.c index fca9d37b89..f39fb47c9b 100644 --- a/time.c +++ b/time.c @@ -11,6 +11,7 @@ #define _DEFAULT_SOURCE #define _BSD_SOURCE +#include "ruby/encoding.h" #include "internal.h" #include #include diff --git a/transcode.c b/transcode.c index 384fdd63fc..c524259354 100644 --- a/transcode.c +++ b/transcode.c @@ -9,6 +9,7 @@ **********************************************************************/ +#include "ruby/encoding.h" #include "internal.h" #include "transcode_data.h" #include diff --git a/variable.c b/variable.c index b74bb7ef90..51891e235d 100644 --- a/variable.c +++ b/variable.c @@ -11,9 +11,10 @@ **********************************************************************/ -#include "internal.h" +#include "ruby/encoding.h" #include "ruby/st.h" #include "ruby/util.h" +#include "internal.h" #include "id_table.h" #include "constant.h" #include "id.h" diff --git a/vm.c b/vm.c index 2675c7de42..8e34e452aa 100644 --- a/vm.c +++ b/vm.c @@ -14,6 +14,7 @@ #include "gc.h" #include "vm_core.h" +#include "vm_debug.h" #include "iseq.h" #include "eval_intern.h" #include "probes.h" diff --git a/vm_backtrace.c b/vm_backtrace.c index d82d73d963..d6a8a1370e 100644 --- a/vm_backtrace.c +++ b/vm_backtrace.c @@ -9,8 +9,9 @@ **********************************************************************/ -#include "internal.h" +#include "ruby/encoding.h" #include "ruby/debug.h" +#include "internal.h" #include "vm_core.h" #include "eval_intern.h" diff --git a/vm_core.h b/vm_core.h index a009ca9f03..c2a4b1ab03 100644 --- a/vm_core.h +++ b/vm_core.h @@ -67,7 +67,6 @@ #include "ruby/st.h" #include "node.h" -#include "vm_debug.h" #include "vm_opts.h" #include "id.h" #include "method.h" -- cgit v1.2.3