<div id="__MailbirdStyleContent" style="font-size: 10pt;font-family: Arial;color: #000000">
                                        
                                        
                                            
                                        
                                        
                                        Hi Nicolas,<div><br></div><div>good idea! I just did that.</div><div><br></div><div><a href="https://stackoverflow.com/questions/49784522/how-one-supports-both-32-and-64-bits-target-in-squeak-ffi"><span style="font-size: 10pt">https://stackoverflow.com/questions/49784522/how-one-supports-both-32-and-64-bits-target-in-squeak-ffi</span></a><br></div><div><a href="https://stackoverflow.com/questions/49784253/how-one-deals-with-multiple-pointer-level-like-char-in-squeak-ffi"><span style="font-size: 10pt">https://stackoverflow.com/questions/49784253/how-one-deals-with-multiple-pointer-level-like-char-in-squeak-ffi</span></a><br></div><div><a href="https://stackoverflow.com/questions/49783882/how-one-deals-with-typedefs-in-squeak-ffi"><span style="font-size: 10pt">https://stackoverflow.com/questions/49783882/how-one-deals-with-typedefs-in-squeak-ffi</span></a><br></div><div><a href="https://stackoverflow.com/questions/49783126/how-one-defines-a-union-type-in-squeak-ffi"><span style="font-size: 10pt">https://stackoverflow.com/questions/49783126/how-one-defines-a-union-type-in-squeak-ffi</span></a><br></div><div><a href="https://stackoverflow.com/questions/49782651/how-one-aligns-structure-fields-in-squeak-ffi"><span style="font-size: 10pt">https://stackoverflow.com/questions/49782651/how-one-aligns-structure-fields-in-squeak-ffi</span></a><br></div><div><br></div><div>Best,</div><div>Marcel</div><div class="mb_sig"></div>
                                        
                                        <blockquote class="history_container" type="cite" style="border-left-style: solid;border-width: 1px;margin-top: 20px;margin-left: 0px;padding-left: 10px;min-width: 500px">
                        <p style="color: #AAAAAA; margin-top: 10px;">Am 09.06.2020 22:42:03 schrieb Nicolas Cellier <nicolas.cellier.aka.nice@gmail.com>:</p><div style="font-family:Arial,Helvetica,sans-serif">
<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Le mar. 9 juin 2020 à 22:39, Nicolas Cellier <<a href="mailto:nicolas.cellier.aka.nice@gmail.com">nicolas.cellier.aka.nice@gmail.com</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex;border-left: 1px solid rgb(204,204,204);padding-left: 1ex;min-width: 500px"><div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Le mar. 9 juin 2020 à 19:19, Marcel Taeumel <<a href="mailto:marcel.taeumel@hpi.de" target="_blank">marcel.taeumel@hpi.de</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex;border-left: 1px solid rgb(204,204,204);padding-left: 1ex;min-width: 500px"><div id="gmail-m_-5657630488684168776gmail-m_9045335790527019054__MailbirdStyleContent" style="font-size: 10pt;font-family: Arial;color: rgb(0,0,0)">Hi, there.<div></div><div><br></div><div>I want to understand how data models for 64-bit influence the image side of Squeak FFI.</div><div><span style="font-size: 10pt"><a href="https://en.wikipedia.org/wiki/64-bit_computing#64-bit_data_models" target="_blank">https://en.wikipedia.org/wiki/64-bit_computing#64-bit_data_models</a></span><br></div><div><br></div><div>I discovered that there are test functions in the SqueakFFIPrims plugin (sqFFITestFuncs.c) that expect actual "long" types. So, I assume that that is the "long" from C, not Squeak FFI, and thus different on 64-bit Windows vs. 64-bit Unix.</div><div><br></div><div><span style="font-size: 10pt">ffiTest4LongSum</span><br></div><div><span style="font-size: 10pt">ffiTestLongs8</span><span style="font-size: 10pt"><br></span></div><div><span style="font-size: 10pt">ffiTest8longSum</span><span style="font-size: 10pt"><br></span></div><div><span style="font-size: 13.3333px">ffiTestMixedDoublesAndLongs (!!!)</span><span style="font-size: 10pt"><br></span></div><div><br></div><div><span style="font-size: 10pt">Only the last one is actually called from FFI Tests, which could be worse. Because there is not yet a mechanism in place that considers the data model an 64-bit platforms.</span></div><div><span style="font-size: 10pt"><br></span></div><div><span style="font-size: 10pt">So, I think that an atomic type alias for such a C "long" argument could be defined like this:</span></div><div><span style="font-size: 10pt"><br></span></div><div><span style="font-size: 10pt">(wordSize = 4 or: [platformName = 'Win32'])</span></div><div><span style="font-size: 10pt">   ifTrue: ['long' "meaning 'int' in the plugin]</span></div><div><span style="font-size: 10pt">   ifFalse: ['longlong']</span></div><div><span style="font-size: 10pt"><br></span></div></div></blockquote><div>BTW, I documented as I discovered in a serie of SO questions like <br></div></div></div></blockquote><div><br></div><div>I'm on a poor man hp sucking touchpad... Give me back my Mac!<br></div><div><a href="https://stackoverflow.com/questions/49784522/how-one-supports-both-32-and-64-bits-target-in-squeak-ffi">https://stackoverflow.com/questions/49784522/how-one-supports-both-32-and-64-bits-target-in-squeak-ffi</a></div><div><br></div><div>Feel free to add new answers for updated FFI when ready.</div><div><br> </div><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex;border-left: 1px solid rgb(204,204,204);padding-left: 1ex;min-width: 500px"><div dir="ltr"><div class="gmail_quote"><div></div><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex;border-left: 1px solid rgb(204,204,204);padding-left: 1ex;min-width: 500px"><div id="gmail-m_-5657630488684168776gmail-m_9045335790527019054__MailbirdStyleContent" style="font-size: 10pt;font-family: Arial;color: rgb(0,0,0)"><div><span style="font-size: 10pt"></span></div><div><span style="font-size: 10pt">Yet, I have no clue on how to name such a type alias. long_t ? native_long_t ? Squeak FFI's 'long' is already taken, and it is always 4 byte.</span></div><div><span style="font-size: 10pt"><br></span></div></div></blockquote><div>Me neither... c_long?</div><div> <br></div><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex;border-left: 1px solid rgb(204,204,204);padding-left: 1ex;min-width: 500px"><div id="gmail-m_-5657630488684168776gmail-m_9045335790527019054__MailbirdStyleContent" style="font-size: 10pt;font-family: Arial;color: rgb(0,0,0)"><div><span style="font-size: 10pt"></span></div><div><span style="font-size: 10pt">Would it make sense to also query the data model through a primitive and add that to FFIPlatformDescription? LLP64, LP64, ILP64, SILP64, ... </span></div><div><span style="font-size: 10pt"><br></span></div></div></blockquote><div>YAGNI</div><div> <br></div><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex;border-left: 1px solid rgb(204,204,204);padding-left: 1ex;min-width: 500px"><div id="gmail-m_-5657630488684168776gmail-m_9045335790527019054__MailbirdStyleContent" style="font-size: 10pt;font-family: Arial;color: rgb(0,0,0)"><div><span style="font-size: 10pt"></span></div><div><span style="font-size: 10pt">Best,</span></div><div><span style="font-size: 10pt">Marcel</span></div></div><br>
</blockquote></div></div>
</blockquote></div></div>
</div></blockquote></div>