diff options
author | 卜部昌平 <shyouhei@ruby-lang.org> | 2020-07-10 18:31:26 +0900 |
---|---|---|
committer | 卜部昌平 <shyouhei@ruby-lang.org> | 2020-07-13 08:56:18 +0900 |
commit | 4506f6119a047eea5a76db89834c31578780c442 (patch) | |
tree | 37537029f92e94484f486c9a114728c0624e6e49 /tool/mk_builtin_loader.rb | |
parent | 2363a16e9ac3d8ba9608502d9969a39cce03ff17 (diff) |
%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
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/3305
Diffstat (limited to 'tool/mk_builtin_loader.rb')
-rw-r--r-- | tool/mk_builtin_loader.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tool/mk_builtin_loader.rb b/tool/mk_builtin_loader.rb index ffdd840d17..18fa36199e 100644 --- a/tool/mk_builtin_loader.rb +++ b/tool/mk_builtin_loader.rb @@ -311,7 +311,7 @@ def mk_builtin_header file 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 %'}' |