<div dir="ltr">Hi David,<div><br></div><div>    you might look at <span style="font-size:13px;color:rgb(0,0,0)">latforms/unix/plugins/</span><span style="font-size:13px;color:rgb(0,0,0)">SqueakSSL/sqUnixOpenSSL.c in the Cog branch.  It uses e.g.</span></div><div><span style="font-size:13px;color:rgb(0,0,0)"><br></span></div><div><font color="#000000">if(ssl-&gt;loglevel) printf(&quot;sqAcceptSSL: cert = %p\n&quot;, cert);</font><br></div><div><font color="#000000"><br></font></div><div><font color="#000000">instead of </font></div><div><font color="#000000"><br></font></div><div><font color="#000000">if(ssl-&gt;loglevel) printf(&quot;sqAcceptSSL: cert = %lx\n&quot;, (long)cert);<br></font></div><div><font color="#000000"><br></font></div><div><font color="#000000">which is preferrable, as cert is a pointer.  The Cog version definitely compiles on 64-bit; I&#39;m running a 64-bit Spur Stack VM regularly.</font></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jan 29, 2015 at 4:37 PM,  <span dir="ltr">&lt;<a href="mailto:commits@squeakvm.org" target="_blank">commits@squeakvm.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
Revision: 3238<br>
Author:   lewis<br>
Date:     2015-01-29 16:37:29 -0800 (Thu, 29 Jan 2015)<br>
Log Message:<br>
-----------<br>
Compile for 32 or 64 bit host or image, 4 or 8 byte sqInt, squeakvm or squeakvm64.<br>
Change signature of sqGetIntPropertySSL to match declaration in Cross/plugins/SqueakSSL/SqueakSSL.h<br>
For debug printing, cast sqInt to long and print with %ld to prevent warnings when sizeof(sqInt) is 8.<br>
Reference Mantis 7751 (<a href="http://bugs.squeak.org/view.php?id=7751" target="_blank">http://bugs.squeak.org/view.php?id=7751</a>)<br>
<br>
Modified Paths:<br>
--------------<br>
    trunk/platforms/unix/plugins/SqueakSSL/sqUnixOpenSSL.c<br>
<br>
Modified: trunk/platforms/unix/plugins/SqueakSSL/sqUnixOpenSSL.c<br>
===================================================================<br>
--- trunk/platforms/unix/plugins/SqueakSSL/sqUnixOpenSSL.c      2015-01-29 22:46:44 UTC (rev 3237)<br>
+++ trunk/platforms/unix/plugins/SqueakSSL/sqUnixOpenSSL.c      2015-01-30 00:37:29 UTC (rev 3238)<br>
@@ -36,8 +36,8 @@<br>
 sqInt sqCopyBioSSL(sqSSL *ssl, BIO *bio, char *dstBuf, sqInt dstLen) {<br>
   int nbytes = BIO_ctrl_pending(bio);<br>
<br>
-  if(ssl-&gt;loglevel) printf(&quot;sqCopyBioSSL: %d bytes pending; buffer size %d\n&quot;,<br>
-        nbytes, dstLen);<br>
+  if(ssl-&gt;loglevel) printf(&quot;sqCopyBioSSL: %d bytes pending; buffer size %ld\n&quot;,<br>
+        nbytes, (long)dstLen);<br>
   if(nbytes &gt; dstLen) return -1;<br>
   return BIO_read(bio, dstBuf, dstLen);<br>
 }<br>
@@ -156,7 +156,7 @@<br>
        X509 *cert;<br>
        sqSSL *ssl = sslFromHandle(handle);<br>
<br>
-       if(ssl-&gt;loglevel) printf(&quot;sqConnectSSL: %x\n&quot;, (int)ssl);<br>
+       if(ssl-&gt;loglevel) printf(&quot;sqConnectSSL: %lx\n&quot;, (long)ssl);<br>
<br>
        /* Verify state of session */<br>
        if(ssl == NULL || (ssl-&gt;state != SQSSL_UNUSED &amp;&amp; ssl-&gt;state != SQSSL_CONNECTING)) {<br>
@@ -172,7 +172,7 @@<br>
                SSL_set_connect_state(ssl-&gt;ssl);<br>
        }<br>
<br>
-       if(ssl-&gt;loglevel) printf(&quot;sqConnectSSL: BIO_write %d bytes\n&quot;, srcLen);<br>
+       if(ssl-&gt;loglevel) printf(&quot;sqConnectSSL: BIO_write %ld bytes\n&quot;, (long)srcLen);<br>
<br>
        n = BIO_write(ssl-&gt;bioRead, srcBuf, srcLen);<br>
<br>
@@ -202,7 +202,7 @@<br>
<br>
        if(ssl-&gt;loglevel) printf(&quot;sqConnectSSL: SSL_get_peer_certificate\n&quot;);<br>
        cert = SSL_get_peer_certificate(ssl-&gt;ssl);<br>
-       if(ssl-&gt;loglevel) printf(&quot;sqConnectSSL: cert = %x\n&quot;, (int)cert);<br>
+       if(ssl-&gt;loglevel) printf(&quot;sqConnectSSL: cert = %lx\n&quot;, (long)cert);<br>
        /* Fail if no cert received. */<br>
        if(cert) {<br>
                X509_NAME_get_text_by_NID(X509_get_subject_name(cert),<br>
@@ -252,7 +252,7 @@<br>
                SSL_set_accept_state(ssl-&gt;ssl);<br>
        }<br>
<br>
-       if(ssl-&gt;loglevel) printf(&quot;sqAcceptSSL: BIO_write %d bytes\n&quot;, srcLen);<br>
+       if(ssl-&gt;loglevel) printf(&quot;sqAcceptSSL: BIO_write %ld bytes\n&quot;, (long)srcLen);<br>
<br>
        n = BIO_write(ssl-&gt;bioRead, srcBuf, srcLen);<br>
<br>
@@ -286,7 +286,7 @@<br>
<br>
        if(ssl-&gt;loglevel) printf(&quot;sqAcceptSSL: SSL_get_peer_certificate\n&quot;);<br>
        cert = SSL_get_peer_certificate(ssl-&gt;ssl);<br>
-       if(ssl-&gt;loglevel) printf(&quot;sqAcceptSSL: cert = %x\n&quot;, (int)cert);<br>
+       if(ssl-&gt;loglevel) printf(&quot;sqAcceptSSL: cert = %lx\n&quot;, (long)cert);<br>
<br>
        if(cert) {<br>
          X509_NAME_get_text_by_NID(X509_get_subject_name(cert),<br>
@@ -322,7 +322,7 @@<br>
<br>
        if(ssl == NULL || ssl-&gt;state != SQSSL_CONNECTED) return SQSSL_INVALID_STATE;<br>
<br>
-       if(ssl-&gt;loglevel) printf(&quot;sqEncryptSSL: Encrypting %d bytes\n&quot;, srcLen);<br>
+       if(ssl-&gt;loglevel) printf(&quot;sqEncryptSSL: Encrypting %ld bytes\n&quot;, (long)srcLen);<br>
<br>
        nbytes = SSL_write(ssl-&gt;ssl, srcBuf, srcLen);<br>
        if(nbytes != srcLen) return SQSSL_GENERIC_ERROR;<br>
@@ -414,7 +414,7 @@<br>
                propID - the property id to retrieve<br>
        Returns: The integer value of the property.<br>
 */<br>
-int sqGetIntPropertySSL(sqInt handle, int propID) {<br>
+sqInt sqGetIntPropertySSL(sqInt handle, sqInt propID) {<br>
        sqSSL *ssl = sslFromHandle(handle);<br>
<br>
        if(ssl == NULL) return 0;<br>
@@ -424,7 +424,7 @@<br>
                case SQSSL_PROP_VERSION: return 1;<br>
                case SQSSL_PROP_LOGLEVEL: return ssl-&gt;loglevel;<br>
                default:<br>
-                       if(ssl-&gt;loglevel) printf(&quot;sqGetIntPropertySSL: Unknown property ID %d\n&quot;, propID);<br>
+                       if(ssl-&gt;loglevel) printf(&quot;sqGetIntPropertySSL: Unknown property ID %ld\n&quot;, (long)propID);<br>
                        return 0;<br>
        }<br>
        return 0;<br>
@@ -444,7 +444,7 @@<br>
        switch(propID) {<br>
                case SQSSL_PROP_LOGLEVEL: ssl-&gt;loglevel = propValue; break;<br>
                default:<br>
-                       if(ssl-&gt;loglevel) printf(&quot;sqSetIntPropertySSL: Unknown property ID %d\n&quot;, propID);<br>
+                       if(ssl-&gt;loglevel) printf(&quot;sqSetIntPropertySSL: Unknown property ID %ld\n&quot;, (long)propID);<br>
                        return 0;<br>
        }<br>
        return 1;<br>
<br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">best,<div>Eliot</div></div>
</div>