1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

%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
This commit is contained in:
卜部昌平 2020-07-10 18:31:26 +09:00
parent 2363a16e9a
commit 4506f6119a
Notes: git 2020-07-13 08:56:51 +09:00

View file

@ -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 %'}'