RFR: 8324865: windows-x64-slowdebug still does not build after JDK-8324840
Vladimir Kozlov
kvn at openjdk.org
Mon Jan 29 23:52:54 UTC 2024
On Mon, 29 Jan 2024 22:48:39 GMT, David Holmes <dholmes at openjdk.org> wrote:
>> [~jwaters] commented in the PR [#17613](https://github.com/openjdk/jdk/pull/17613) that on windows we have strtok_s instead of strtok_r. We may need to #include "runtime/os.hpp" which defined strtok_r for windows instead of <string.hpp>.
>>
>> Including os.hpp will increase compilation time for all files which inclide "stringUtils.hpp".
>> I suggest to move code from .hpp to .cpp file. It is used only by c2 and inlining of this code is not too important.
>>
>> Tested tier1 and tier2 builds with precompiled headers off.
>
> I think the "right" fix here would be to define `os::strtok_r` which calls `strtok_s` on Windows and `strtok_r` elsewhere.
>
> The quickest/simplest fix would be to just add this to `stringUtils.hpp`:
>
> #ifdef _WINDOWS
> // strtok_s is the Windows thread-safe equivalent of POSIX strtok_r
> # define strtok_r strtok_s
> #endif
@dholmes-ora, I used your suggestion and tested it (passed).
-------------
PR Comment: https://git.openjdk.org/jdk/pull/17622#issuecomment-1915777540
More information about the hotspot-dev
mailing list