[foreign-memaccess+abi] RFR: 8268169: The system lookup can not find stdio functions such as printf on Windows 10

Jorn Vernee jvernee at openjdk.java.net
Thu Jun 3 17:25:46 UTC 2021


On Thu, 3 Jun 2021 13:27:56 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:

>> Hi,
>> 
>> This patch adds a way to look up stdio functions such as printf on Windows 10 through the system lookup. A fallback library is used which forces the generation of these inline functions, and exposes them through a table of function pointers.
>> 
>> Thanks,
>> Jorn
>
> src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/SystemLookup.java line 174:
> 
>> 172:         private static final Map<String, WindowsFallbackSymbols> BY_NAME;
>> 173: 
>> 174:         static {
> 
> Wouldn't Enum.valueOf achieve the same result here?

Right, I'm so used to the static map idiom for when the key is something else than the name that I didn't really think about using Enum.valueOf.

I'll switch to using valueOf.

-------------

PR: https://git.openjdk.java.net/panama-foreign/pull/547


More information about the panama-dev mailing list