diff options
author | Benoit Daloze <[email protected]> | 2021-04-29 14:31:05 +0200 |
---|---|---|
committer | Benoit Daloze <[email protected]> | 2021-05-04 14:56:55 +0200 |
commit | 68d6bd0873557c12bec6f8e0f8db622f1499d8a7 () | |
tree | dd50dae6ebbf714d19e3db7272f0d9b6af86223e | |
parent | 229cbeba8c928dc6ee5eb21951e00c43a6e5225c (diff) |
Fix trivial -Wundef warnings
* See [Feature #17752] Co-authored-by: xtkoba (Tee KOBAYASHI) <[email protected]>
Notes: Merged: https://.com/ruby/ruby/pull/4428
-rw-r--r-- | builtin.c | 2 | ||||
-rw-r--r-- | builtin.h | 2 | ||||
-rw-r--r-- | dir.c | 2 | ||||
-rw-r--r-- | eval_intern.h | 2 | ||||
-rw-r--r-- | gc.c | 2 | ||||
-rw-r--r-- | hash.c | 2 | ||||
-rw-r--r-- | include/ruby/internal/attr/const.h | 2 | ||||
-rw-r--r-- | memory_view.c | 4 | ||||
-rw-r--r-- | ractor_core.h | 2 | ||||
-rw-r--r-- | ruby.c | 2 | ||||
-rw-r--r-- | template/sizes.c.tmpl | 2 | ||||
-rw-r--r-- | thread_pthread.h | 2 | ||||
-rw-r--r-- | tool/mk_builtin_loader.rb | 2 | ||||
-rw-r--r-- | vm.c | 2 | ||||
-rw-r--r-- | vm_core.h | 8 | ||||
-rw-r--r-- | vm_exec.c | 2 |
16 files changed, 21 insertions, 19 deletions
@@ -3,7 +3,7 @@ #include "iseq.h" #include "builtin.h" -#if CROSS_COMPILING #define INCLUDED_BY_BUILTIN_C 1 #include "mini_builtin.c" @@ -65,7 +65,7 @@ PUREFUNC(static inline VALUE rb_vm_lvar(rb_execution_context_t *ec, int index)); static inline VALUE rb_vm_lvar(rb_execution_context_t *ec, int index) { -#if VM_CORE_H_EC_DEFINED return ec->cfp->ep[index]; #else return rb_vm_lvar_exposed(ec, index); @@ -216,7 +216,7 @@ typedef enum { #else #define FNM_SYSCASE 0 #endif -#if _WIN32 #define FNM_SHORTNAME 0x20 #else #define FNM_SHORTNAME 0 @@ -144,7 +144,7 @@ LONG WINAPI rb_w32_stack_overflow_handler(struct _EXCEPTION_POINTERS *); #define EC_REPUSH_TAG() (void)(_ec->tag = &_tag) -#if defined __GNUC__ && __GNUC__ == 4 && (__GNUC_MINOR__ >= 6 && __GNUC_MINOR__ <= 8) || __clang__ /* This macro prevents GCC 4.6--4.8 from emitting maybe-uninitialized warnings. * This macro also prevents Clang from dumping core in EC_EXEC_TAG(). * (I confirmed Clang 4.0.1 and 5.0.0.) @@ -830,7 +830,7 @@ enum { }; #define HEAP_PAGE_ALIGN (1 << HEAP_PAGE_ALIGN_LOG) #define HEAP_PAGE_SIZE HEAP_PAGE_ALIGN -#if defined(HAVE_MMAP) && (PAGE_SIZE <= HEAP_PAGE_SIZE) # define USE_MMAP_ALIGNED_ALLOC 1 #else # define USE_MMAP_ALIGNED_ALLOC 0 @@ -800,7 +800,7 @@ ar_force_convert_table(VALUE hash, const char *file, int line) if (RHASH_AR_TABLE(hash)) { unsigned i, bound = RHASH_AR_TABLE_BOUND(hash); -#if RHASH_CONVERT_TABLE_DEBUG rb_obj_info_dump(hash); fprintf(stderr, "force_convert: %s:%d\n", file, line); RB_DEBUG_COUNTER_INC(obj_hash_force_convert); @@ -37,7 +37,7 @@ #endif /** Enables #RBIMPL_ATTR_CONST if and only if. ! #RUBY_DEBUG. */ -#if !RUBY_DEBUG # define RBIMPL_ATTR_CONST_UNLESS_DEBUG() RBIMPL_ATTR_CONST() #else # define RBIMPL_ATTR_CONST_UNLESS_DEBUG() /* void */ @@ -671,7 +671,7 @@ extract_item_member(const uint8_t *ptr, const rb_memory_view_item_component_t *m return LL2NUM(val.ll); } else { -#if SIZEOF_INT64_t == SIZEOF_LONG return LONG2NUM(val.i64); #else return LL2NUM(val.i64); @@ -683,7 +683,7 @@ extract_item_member(const uint8_t *ptr, const rb_memory_view_item_component_t *m return ULL2NUM(val.ull); } else { -#if SIZEOF_UINT64_t == SIZEOF_LONG return ULONG2NUM(val.u64); #else return ULL2NUM(val.u64); @@ -261,7 +261,7 @@ static inline void rb_ractor_set_current_ec(rb_ractor_t *cr, rb_execution_context_t *ec) { #ifdef RB_THREAD_LOCAL_SPECIFIER - #if __APPLE__ rb_current_ec_set(ec); #else ruby_current_ec = ec; @@ -1826,7 +1826,7 @@ process_options(int argc, char **argv, ruby_cmdline_options_t *opt) opt->script_name = rb_str_new_cstr(opt->script); opt->script = RSTRING_PTR(opt->script_name); -#if _WIN32 translit_char_bin(RSTRING_PTR(opt->script_name), '\\', '/'); #elif defined DOSISH translit_char(RSTRING_PTR(opt->script_name), '\\', '/'); @@ -43,7 +43,7 @@ Init_sizeof(void) % next % end % cond = conditions[type] -#if SIZEOF_<%= type.tr_cpp %> != 0<%= " && #{cond}" if cond %> DEFINE(<%= type %>, <%= type.tr_cpp %>); #endif % end @@ -100,7 +100,7 @@ native_tls_set(native_tls_key_t key, void *ptr) RUBY_SYMBOL_EXPORT_BEGIN #ifdef RB_THREAD_LOCAL_SPECIFIER - #if __APPLE__ // on Darwin, TLS can not be accessed across .so struct rb_execution_context_struct *rb_current_ec(); void rb_current_ec_set(struct rb_execution_context_struct *); @@ -343,7 +343,7 @@ def mk_builtin_header file f.puts f.puts " // arity_check" f.puts "COMPILER_WARNING_PUSH" - f.puts "#if GCC_VERSION_SINCE(5, 1, 0) || __clang__" f.puts "COMPILER_WARNING_ERROR(-Wincompatible-pointer-types)" f.puts "#endif" bs.each{|func, (argc, cfunc_name)| @@ -3262,7 +3262,7 @@ static VALUE nsdr(VALUE self) { VALUE ary = rb_ary_new(); -#if HAVE_BACKTRACE #include <execinfo.h> #define MAX_NATIVE_TRACE 1024 static void *trace[MAX_NATIVE_TRACE]; @@ -670,7 +670,7 @@ typedef struct rb_vm_struct { #endif const struct rb_callcache *global_cc_cache_table[VM_GLOBAL_CC_CACHE_TABLE_SIZE]; // vm_eval.c -#if USE_VM_CLOCK uint32_t clock; #endif @@ -870,7 +870,7 @@ struct rb_execution_context_struct { /* interrupt flags */ rb_atomic_t interrupt_flag; rb_atomic_t interrupt_mask; /* size should match flag */ -#if USE_VM_CLOCK uint32_t checked_clock; #endif @@ -1804,7 +1804,7 @@ static inline rb_execution_context_t * rb_current_execution_context(void) { #ifdef RB_THREAD_LOCAL_SPECIFIER - #if __APPLE__ rb_execution_context_t *ec = rb_current_ec(); #else rb_execution_context_t *ec = ruby_current_ec; @@ -1891,7 +1891,7 @@ enum { static inline bool RUBY_VM_INTERRUPTED_ANY(rb_execution_context_t *ec) { -#if USE_VM_CLOCK uint32_t current_clock = rb_ec_vm_ptr(ec)->clock; if (current_clock != ec->checked_clock) { @@ -104,6 +104,8 @@ vm_exec_core(rb_execution_context_t *ec, VALUE initial) #else register rb_control_frame_t *reg_cfp; const VALUE *reg_pc; #endif #if USE_MACHINE_REGS |