Project

General

Profile

Feature #17752 ยป ruby-trivial-undefind-macros-0002.patch

xtkoba (Tee KOBAYASHI), 04/14/2021 12:59 AM

View differences:

builtin.c
3 3
#include "iseq.h"
4 4
#include "builtin.h"
5 5

  
6
#if CROSS_COMPILING
6
#ifdef CROSS_COMPILING
7 7

  
8 8
#define INCLUDED_BY_BUILTIN_C 1
9 9
#include "mini_builtin.c"
10
-- a/eval_intern.h
10
++ b/eval_intern.h
......
144 144

  
145 145
#define EC_REPUSH_TAG() (void)(_ec->tag = &_tag)
146 146

  
147
#if defined __GNUC__ && __GNUC__ == 4 && (__GNUC_MINOR__ >= 6 && __GNUC_MINOR__ <= 8) || __clang__
147
#if defined __GNUC__ && __GNUC__ == 4 && (__GNUC_MINOR__ >= 6 && __GNUC_MINOR__ <= 8) || defined __clang__
148 148
/* This macro prevents GCC 4.6--4.8 from emitting maybe-uninitialized warnings.
149 149
 * This macro also prevents Clang from dumping core in EC_EXEC_TAG().
150 150
 * (I confirmed Clang 4.0.1 and 5.0.0.)
151
-- a/template/sizes.c.tmpl
151
++ b/template/sizes.c.tmpl
......
43 43
%     next
44 44
%   end
45 45
%   cond = conditions[type]
46
#if SIZEOF_<%= type.tr_cpp %> != 0<%= " && #{cond}" if cond %>
46
#if defined(SIZEOF_<%= type.tr_cpp %>) && SIZEOF_<%= type.tr_cpp %> != 0<%= " && #{cond}" if cond %>
47 47
    DEFINE(<%= type %>, <%= type.tr_cpp %>);
48 48
#endif
49 49
% end
50
-- a/tool/mk_builtin_loader.rb
50
++ b/tool/mk_builtin_loader.rb
......
343 343
    f.puts
344 344
    f.puts "  // arity_check"
345 345
    f.puts "COMPILER_WARNING_PUSH"
346
    f.puts "#if GCC_VERSION_SINCE(5, 1, 0) || __clang__"
346
    f.puts "#if GCC_VERSION_SINCE(5, 1, 0) || defined __clang__"
347 347
    f.puts "COMPILER_WARNING_ERROR(-Wincompatible-pointer-types)"
348 348
    f.puts "#endif"
349 349
    bs.each{|func, (argc, cfunc_name)|