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

Maurizio Cimadamore mcimadamore at openjdk.java.net
Thu Jun 3 13:32:57 UTC 2021


On Thu, 3 Jun 2021 12:50:13 GMT, Jorn Vernee <jvernee 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?

src/jdk.incubator.foreign/windows/native/libWinFallbackLookup/WinFallbackLookup.c line 86:

> 84:     // time.h
> 85:     &gmtime
> 86: };

Missing newline here

test/jdk/java/foreign/StdLibTest.java line 158:

> 156:     static class StdLibHelper {
> 157: 
> 158:         final static SymbolLookup LOOKUP = CLinker.systemLookup();

Nice simplification!

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

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


More information about the panama-dev mailing list