ruby-changes:62198
From: =E5=8D=9C=E9=83=A8=E6=98=8C=E5=B9=B3 <ko1@a...>
Date: Mon, 13 Jul 2020 08:56:42 +0900 (JST)
Subject: [ruby-changes:62198] 4506f6119a (master): %p is not portable accross platforms
https://git.ruby-lang.org/ruby.git/commit/?id=4506f6119a From 4506f6119a047eea5a76db89834c31578780c442 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=9C=E9=83=A8=E6=98=8C=E5=B9=B3?= <shyouhei@r...> Date: Fri, 10 Jul 2020 18:31:26 +0900 Subject: %p is not portable accross platforms This commit fixes compiler error on MSVC. %p on that platform is not suitable to represent a compile-time constant. https://ci.appveyor.com/project/ruby/ruby/builds/34017163/job/vj2a8uk3gwv9yxak#L24381 diff --git a/tool/mk_builtin_loader.rb b/tool/mk_builtin_loader.rb index ffdd840..18fa361 100644 --- a/tool/mk_builtin_loader.rb +++ b/tool/mk_builtin_loader.rb @@ -311,7 +311,7 @@ def mk_builtin_header file https://github.com/ruby/ruby/blob/trunk/tool/mk_builtin_loader.rb#L311 f.puts %' fprintf(f, " const VALUE *argv = GET_EP() - lnum - VM_ENV_DATA_SIZE + 1 + %ld;\\n", index);' f.puts %' }' end - f.puts %' fprintf(f, " func f = (func)/* #{cfunc_name} */%p;\\n", (const void *)#{cfunc_name});' + f.puts %' fprintf(f, " func f = (func)%"PRIdPTR"; /* == #{cfunc_name} */\\n", (intptr_t)#{cfunc_name});' f.puts %' fprintf(f, " val = f(ec, GET_SELF()#{argv});\\n");' end f.puts %'}' -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/