<div style="font-family: Arial; font-size: 14px;">Hi,</div><div style="font-family: Arial; font-size: 14px;"><br></div><div style="font-family: Arial; font-size: 14px;">About JExtract containing samples seamingly to JDK20 : where can I find JDK20 for Panama? </div><div style="font-family: Arial; font-size: 14px;"><br></div><div style="font-family: Arial; font-size: 14px;">I just downloaded <a href="https://jdk.java.net/20/" title="JDK20 EA Build here">JDK20 EA Build here</a> but jextract was not part of the distribution.</div><div style="font-family: Arial; font-size: 14px;"><br></div><div style="font-family: Arial; font-size: 14px;">Thanks,</div><div style="font-family: Arial; font-size: 14px;"><br></div><div style="font-family: Arial; font-size: 14px;">Martin</div><div style="font-family: Arial; font-size: 14px;"><br></div>
<div class="protonmail_signature_block" style="font-family: Arial; font-size: 14px;">
<div class="protonmail_signature_block-user protonmail_signature_block-empty">
</div>
<div class="protonmail_signature_block-proton">
Envoyé avec la messagerie sécurisée <a target="_blank" href="https://proton.me/" rel="noopener noreferrer">Proton Mail</a>.
</div>
</div>
<div style="font-family: Arial; font-size: 14px;"><br></div><div class="protonmail_quote">
------- Original Message -------<br>
Le mercredi 28 décembre 2022 à 17:01, Martin Pernollet <martin.pernollet@protonmail.com> a écrit :<br><br>
<blockquote class="protonmail_quote" type="cite">
<div style="font-family: Arial; font-size: 14px;">Thank you. I know these documents and rather lacks complete exemples that can work for an identified JDK version.</div><div style="font-family: Arial; font-size: 14px;"><br></div><div style="font-family: Arial; font-size: 14px;">I went back to JExtract samples, especially the opengl <a title="teapot" href="https://github.com/openjdk/jextract/blob/master/samples/opengl/Teapot.java" rel="noreferrer nofollow noopener" target="_blank">teapot</a>, but I can't compile it with JDK 19... seamingly the <a title="imports refer to the JDK 20 package names" href="https://github.com/openjdk/jextract/blob/master/samples/opengl/Teapot.java#L32" rel="noreferrer nofollow noopener" target="_blank">imports refer to the JDK 20 package names</a>.</div><div style="font-family: Arial; font-size: 14px;"><br></div><div style="font-family: Arial; font-size: 14px;">What I still miss is <p style="margin:0px;font:12px Helvetica;color:rgb(128, 128, 128)">import static jdk.incubator.foreign.CLinker.C_INT</p><p style="margin:0px;font:12px Helvetica;color:rgb(128, 128, 128)"><br></p><p style="margin:0px;font:12px Helvetica;color:rgb(128, 128, 128)"><span style="font-family: Arial; font-size: 14px; color: rgb(0, 0, 0);">and other C_TYPE. </span></p><p style="margin:0px;font:12px Helvetica;color:rgb(128, 128, 128)"><span style="font-family: Arial; font-size: 14px; color: rgb(0, 0, 0);"><br></span></p><p style="margin:0px;font:12px Helvetica;color:rgb(128, 128, 128)"><span style="font-family: Arial; font-size: 14px; color: rgb(0, 0, 0);">They where static constants in JDK17 but then have gone. Where should we find this as of JDK19?</span></p></div><div style="font-family: Arial; font-size: 14px;" class="protonmail_signature_block"><div class="protonmail_signature_block-proton"><br></div><div class="protonmail_signature_block-proton">Thanks in advance!</div><div class="protonmail_signature_block-proton"><br></div></div><div class="protonmail_quote">
------- Original Message -------<br>
Le mercredi 28 décembre 2022 à 14:34, Maurizio Cimadamore <maurizio.cimadamore@oracle.com> a écrit :<br><br>
<blockquote type="cite" class="protonmail_quote">
<p>Hi,<br>
I suggest you start looking at some of the documents we have
available to get started - for JDK 19 you can look here:</p>
<p><a target="_blank" rel="noreferrer nofollow noopener" class="moz-txt-link-freetext" href="https://github.com/openjdk/panama-foreign/blob/21452ec32b27ba906ec06253e4a7af9037728174/doc/panama_memaccess.md">https://github.com/openjdk/panama-foreign/blob/21452ec32b27ba906ec06253e4a7af9037728174/doc/panama_memaccess.md</a></p>
<p>In short, you always need to provide a layout constant of the
right kind when doing allocation using an allocator (and also when
doing dereference).</p>
<p>Value layout constants are provided in the ValueLayout class
(e.g. ValueLayout.JAVA_DOUBLE).</p>
<p>If you use jextract, additional constants (e.g. C_INT, C_LONG,
...) will be provided.<br>
</p>
<div class="moz-cite-prefix">On 23/12/2022 16:20, Martin Pernollet
wrote:<br>
</div>
<blockquote type="cite">
<div style="font-family: Arial; font-size: 14px;">Hi,</div>
<div style="font-family: Arial; font-size: 14px;"><br>
</div>
<div style="font-family: Arial; font-size: 14px;">Would anyone
suggest examples showing how to use Panama 19 instead of 17? A
couple of things have changed ( e.g. how to use the new
<pre style="background-color:#2b2b2b;color:#a9b7c6;font-family:'JetBrains Mono',monospace;font-size:9,8pt"><span style="color:#9876aa">locator</span>.allocateArray(<span style="color:#cc7832">new </span>ValueLayout.OfDouble(</pre>
, and deal with all other datatypes, strings, etc).</div>
<div style="font-family: Arial; font-size: 14px;"><br>
</div>
<div style="font-family: Arial; font-size: 14px;">One additional
question : when will ARM be supported to run panama on Apple
M1? <br>
</div>
</blockquote>
<p>Apple M1 is mostly supported on JDK 19 - modulo few corner cases
which have been addressed in Java 20.</p>
<p>Maurizio<br>
</p>
<blockquote type="cite">
<div style="font-family: Arial; font-size: 14px;"><br>
</div>
<div class="protonmail_signature_block" style="font-family: Arial;
font-size: 14px;">
<div class="protonmail_signature_block-user
protonmail_signature_block-empty"> </div>
<div class="protonmail_signature_block-proton">Regards,</div>
<div class="protonmail_signature_block-proton"><br>
</div>
<div class="protonmail_signature_block-proton">Martin</div>
</div>
</blockquote>
</blockquote><br>
</div>
</blockquote><br>
</div>