RFR: 8345589: Simplify Windows definition of strtok_r

Kim Barrett kim.barrett at oracle.com
Fri Dec 6 17:16:22 UTC 2024


On 12/6/24 3:10 AM, Julian Waters wrote:
> On Fri, 6 Dec 2024 06:25:12 GMT, Kim Barrett<kbarrett at openjdk.org> wrote:
>
>> Please review this change to move the Windows-specific definition of strtok_r
>> to globalDefinitions_visCPP.hpp.  In addition, the unused S_ISCHR macro is
>> removed and the S_ISFIFO macro is also moved.
>>
>> Testing: mach5 tier1
> This moves it to a place inaccessible to my port, but it's a small change and I can handle it rather easily, so I'm ok with this.

I suspected that might happen.  But this new location seems like a 
better place for it than where it was.

I'm assuming you're going to have some non-trivial rearrangement of 
things in the globalDefinitions vicinity.

> src/hotspot/share/utilities/globalDefinitions_visCPP.hpp line 89:
>
>> 87: // under the name strtok_s_l.  Make strtok_r a synonym so we can use that name
>> 88: // in shared code.
>> 89: const auto strtok_r = strtok_s;
> Just 1 question, is strtok_r in this VC definition a function pointer?
Yes.
>   I don't think I've ever seen code do this before. Also, I think Annex K is C11, not C99
Oops. I thought I had C99 open when I was looking at Annex K.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/hotspot-dev/attachments/20241206/64dfe516/attachment-0001.htm>


More information about the hotspot-dev mailing list