Revision: 3238 Author: lewis Date: 2015-01-29 16:37:29 -0800 (Thu, 29 Jan 2015) Log Message: ----------- Compile for 32 or 64 bit host or image, 4 or 8 byte sqInt, squeakvm or squeakvm64. Change signature of sqGetIntPropertySSL to match declaration in Cross/plugins/SqueakSSL/SqueakSSL.h For debug printing, cast sqInt to long and print with %ld to prevent warnings when sizeof(sqInt) is 8. Reference Mantis 7751 (http://bugs.squeak.org/view.php?id=7751)
Modified Paths: -------------- trunk/platforms/unix/plugins/SqueakSSL/sqUnixOpenSSL.c
Modified: trunk/platforms/unix/plugins/SqueakSSL/sqUnixOpenSSL.c =================================================================== --- trunk/platforms/unix/plugins/SqueakSSL/sqUnixOpenSSL.c 2015-01-29 22:46:44 UTC (rev 3237) +++ trunk/platforms/unix/plugins/SqueakSSL/sqUnixOpenSSL.c 2015-01-30 00:37:29 UTC (rev 3238) @@ -36,8 +36,8 @@ sqInt sqCopyBioSSL(sqSSL *ssl, BIO *bio, char *dstBuf, sqInt dstLen) { int nbytes = BIO_ctrl_pending(bio);
- if(ssl->loglevel) printf("sqCopyBioSSL: %d bytes pending; buffer size %d\n", - nbytes, dstLen); + if(ssl->loglevel) printf("sqCopyBioSSL: %d bytes pending; buffer size %ld\n", + nbytes, (long)dstLen); if(nbytes > dstLen) return -1; return BIO_read(bio, dstBuf, dstLen); } @@ -156,7 +156,7 @@ X509 *cert; sqSSL *ssl = sslFromHandle(handle);
- if(ssl->loglevel) printf("sqConnectSSL: %x\n", (int)ssl); + if(ssl->loglevel) printf("sqConnectSSL: %lx\n", (long)ssl);
/* Verify state of session */ if(ssl == NULL || (ssl->state != SQSSL_UNUSED && ssl->state != SQSSL_CONNECTING)) { @@ -172,7 +172,7 @@ SSL_set_connect_state(ssl->ssl); }
- if(ssl->loglevel) printf("sqConnectSSL: BIO_write %d bytes\n", srcLen); + if(ssl->loglevel) printf("sqConnectSSL: BIO_write %ld bytes\n", (long)srcLen);
n = BIO_write(ssl->bioRead, srcBuf, srcLen);
@@ -202,7 +202,7 @@
if(ssl->loglevel) printf("sqConnectSSL: SSL_get_peer_certificate\n"); cert = SSL_get_peer_certificate(ssl->ssl); - if(ssl->loglevel) printf("sqConnectSSL: cert = %x\n", (int)cert); + if(ssl->loglevel) printf("sqConnectSSL: cert = %lx\n", (long)cert); /* Fail if no cert received. */ if(cert) { X509_NAME_get_text_by_NID(X509_get_subject_name(cert), @@ -252,7 +252,7 @@ SSL_set_accept_state(ssl->ssl); }
- if(ssl->loglevel) printf("sqAcceptSSL: BIO_write %d bytes\n", srcLen); + if(ssl->loglevel) printf("sqAcceptSSL: BIO_write %ld bytes\n", (long)srcLen);
n = BIO_write(ssl->bioRead, srcBuf, srcLen);
@@ -286,7 +286,7 @@
if(ssl->loglevel) printf("sqAcceptSSL: SSL_get_peer_certificate\n"); cert = SSL_get_peer_certificate(ssl->ssl); - if(ssl->loglevel) printf("sqAcceptSSL: cert = %x\n", (int)cert); + if(ssl->loglevel) printf("sqAcceptSSL: cert = %lx\n", (long)cert);
if(cert) { X509_NAME_get_text_by_NID(X509_get_subject_name(cert), @@ -322,7 +322,7 @@
if(ssl == NULL || ssl->state != SQSSL_CONNECTED) return SQSSL_INVALID_STATE;
- if(ssl->loglevel) printf("sqEncryptSSL: Encrypting %d bytes\n", srcLen); + if(ssl->loglevel) printf("sqEncryptSSL: Encrypting %ld bytes\n", (long)srcLen);
nbytes = SSL_write(ssl->ssl, srcBuf, srcLen); if(nbytes != srcLen) return SQSSL_GENERIC_ERROR; @@ -414,7 +414,7 @@ propID - the property id to retrieve Returns: The integer value of the property. */ -int sqGetIntPropertySSL(sqInt handle, int propID) { +sqInt sqGetIntPropertySSL(sqInt handle, sqInt propID) { sqSSL *ssl = sslFromHandle(handle);
if(ssl == NULL) return 0; @@ -424,7 +424,7 @@ case SQSSL_PROP_VERSION: return 1; case SQSSL_PROP_LOGLEVEL: return ssl->loglevel; default: - if(ssl->loglevel) printf("sqGetIntPropertySSL: Unknown property ID %d\n", propID); + if(ssl->loglevel) printf("sqGetIntPropertySSL: Unknown property ID %ld\n", (long)propID); return 0; } return 0; @@ -444,7 +444,7 @@ switch(propID) { case SQSSL_PROP_LOGLEVEL: ssl->loglevel = propValue; break; default: - if(ssl->loglevel) printf("sqSetIntPropertySSL: Unknown property ID %d\n", propID); + if(ssl->loglevel) printf("sqSetIntPropertySSL: Unknown property ID %ld\n", (long)propID); return 0; } return 1;
YaY!
Thank you!
Best -Tobias
On 30.01.2015, at 01:37, commits@squeakvm.org wrote:
Revision: 3238 Author: lewis Date: 2015-01-29 16:37:29 -0800 (Thu, 29 Jan 2015) Log Message:
Compile for 32 or 64 bit host or image, 4 or 8 byte sqInt, squeakvm or squeakvm64. Change signature of sqGetIntPropertySSL to match declaration in Cross/plugins/SqueakSSL/SqueakSSL.h For debug printing, cast sqInt to long and print with %ld to prevent warnings when sizeof(sqInt) is 8. Reference Mantis 7751 (http://bugs.squeak.org/view.php?id=7751)
Modified Paths:
trunk/platforms/unix/plugins/SqueakSSL/sqUnixOpenSSL.c
Modified: trunk/platforms/unix/plugins/SqueakSSL/sqUnixOpenSSL.c
--- trunk/platforms/unix/plugins/SqueakSSL/sqUnixOpenSSL.c 2015-01-29 22:46:44 UTC (rev 3237) +++ trunk/platforms/unix/plugins/SqueakSSL/sqUnixOpenSSL.c 2015-01-30 00:37:29 UTC (rev 3238) @@ -36,8 +36,8 @@ sqInt sqCopyBioSSL(sqSSL *ssl, BIO *bio, char *dstBuf, sqInt dstLen) { int nbytes = BIO_ctrl_pending(bio);
- if(ssl->loglevel) printf("sqCopyBioSSL: %d bytes pending; buffer size %d\n",
nbytes, dstLen);
- if(ssl->loglevel) printf("sqCopyBioSSL: %d bytes pending; buffer size %ld\n",
if(nbytes > dstLen) return -1; return BIO_read(bio, dstBuf, dstLen);nbytes, (long)dstLen);
} @@ -156,7 +156,7 @@ X509 *cert; sqSSL *ssl = sslFromHandle(handle);
- if(ssl->loglevel) printf("sqConnectSSL: %x\n", (int)ssl);
if(ssl->loglevel) printf("sqConnectSSL: %lx\n", (long)ssl);
/* Verify state of session */ if(ssl == NULL || (ssl->state != SQSSL_UNUSED && ssl->state != SQSSL_CONNECTING)) {
@@ -172,7 +172,7 @@ SSL_set_connect_state(ssl->ssl); }
- if(ssl->loglevel) printf("sqConnectSSL: BIO_write %d bytes\n", srcLen);
if(ssl->loglevel) printf("sqConnectSSL: BIO_write %ld bytes\n", (long)srcLen);
n = BIO_write(ssl->bioRead, srcBuf, srcLen);
@@ -202,7 +202,7 @@
if(ssl->loglevel) printf("sqConnectSSL: SSL_get_peer_certificate\n"); cert = SSL_get_peer_certificate(ssl->ssl);
- if(ssl->loglevel) printf("sqConnectSSL: cert = %x\n", (int)cert);
- if(ssl->loglevel) printf("sqConnectSSL: cert = %lx\n", (long)cert); /* Fail if no cert received. */ if(cert) { X509_NAME_get_text_by_NID(X509_get_subject_name(cert),
@@ -252,7 +252,7 @@ SSL_set_accept_state(ssl->ssl); }
- if(ssl->loglevel) printf("sqAcceptSSL: BIO_write %d bytes\n", srcLen);
if(ssl->loglevel) printf("sqAcceptSSL: BIO_write %ld bytes\n", (long)srcLen);
n = BIO_write(ssl->bioRead, srcBuf, srcLen);
@@ -286,7 +286,7 @@
if(ssl->loglevel) printf("sqAcceptSSL: SSL_get_peer_certificate\n"); cert = SSL_get_peer_certificate(ssl->ssl);
- if(ssl->loglevel) printf("sqAcceptSSL: cert = %x\n", (int)cert);
if(ssl->loglevel) printf("sqAcceptSSL: cert = %lx\n", (long)cert);
if(cert) { X509_NAME_get_text_by_NID(X509_get_subject_name(cert),
@@ -322,7 +322,7 @@
if(ssl == NULL || ssl->state != SQSSL_CONNECTED) return SQSSL_INVALID_STATE;
- if(ssl->loglevel) printf("sqEncryptSSL: Encrypting %d bytes\n", srcLen);
if(ssl->loglevel) printf("sqEncryptSSL: Encrypting %ld bytes\n", (long)srcLen);
nbytes = SSL_write(ssl->ssl, srcBuf, srcLen); if(nbytes != srcLen) return SQSSL_GENERIC_ERROR;
@@ -414,7 +414,7 @@ propID - the property id to retrieve Returns: The integer value of the property. */ -int sqGetIntPropertySSL(sqInt handle, int propID) { +sqInt sqGetIntPropertySSL(sqInt handle, sqInt propID) { sqSSL *ssl = sslFromHandle(handle);
if(ssl == NULL) return 0; @@ -424,7 +424,7 @@ case SQSSL_PROP_VERSION: return 1; case SQSSL_PROP_LOGLEVEL: return ssl->loglevel; default:
if(ssl->loglevel) printf("sqGetIntPropertySSL: Unknown property ID %d\n", propID);
} return 0;if(ssl->loglevel) printf("sqGetIntPropertySSL: Unknown property ID %ld\n", (long)propID); return 0;
@@ -444,7 +444,7 @@ switch(propID) { case SQSSL_PROP_LOGLEVEL: ssl->loglevel = propValue; break; default:
if(ssl->loglevel) printf("sqSetIntPropertySSL: Unknown property ID %d\n", propID);
} return 1;if(ssl->loglevel) printf("sqSetIntPropertySSL: Unknown property ID %ld\n", (long)propID); return 0;
On Fri, Jan 30, 2015 at 01:53:30AM +0100, Tobias Pape wrote:
YaY!
Thank you!
Best -Tobias
Hi Tobias,
I have not actually tested to verify that the plugin works on a 64-bit host VM, which would be the main concern. Can you help me with that?
If you can give me a pointer to a simple test for SSL, I will give it a try on a 64 bit VM and let you know if it works. Or if you do not mind compiling it yourself, just check out a copy of the sources:
$ svn co http://squeakvm.org/svn/squeak/trunk/platforms $ svn co http://squeakvm.org/svn/squeak/trunk/src
Then use the attached Makefile to build the VM. Run it in a ./build directory next to your ./platforms and ./src directories. If the plugin works on a VM compiled for 64 bits, then I'll close out the Mantis 7751 issue.
I am travelling tomorrow but I'll try to follow up on this over the weekend.
Thanks!
Dave
On 30.01.2015, at 01:37, commits@squeakvm.org wrote:
Revision: 3238 Author: lewis Date: 2015-01-29 16:37:29 -0800 (Thu, 29 Jan 2015) Log Message:
Compile for 32 or 64 bit host or image, 4 or 8 byte sqInt, squeakvm or squeakvm64. Change signature of sqGetIntPropertySSL to match declaration in Cross/plugins/SqueakSSL/SqueakSSL.h For debug printing, cast sqInt to long and print with %ld to prevent warnings when sizeof(sqInt) is 8. Reference Mantis 7751 (http://bugs.squeak.org/view.php?id=7751)
Modified Paths:
trunk/platforms/unix/plugins/SqueakSSL/sqUnixOpenSSL.c
Modified: trunk/platforms/unix/plugins/SqueakSSL/sqUnixOpenSSL.c
--- trunk/platforms/unix/plugins/SqueakSSL/sqUnixOpenSSL.c 2015-01-29 22:46:44 UTC (rev 3237) +++ trunk/platforms/unix/plugins/SqueakSSL/sqUnixOpenSSL.c 2015-01-30 00:37:29 UTC (rev 3238) @@ -36,8 +36,8 @@ sqInt sqCopyBioSSL(sqSSL *ssl, BIO *bio, char *dstBuf, sqInt dstLen) { int nbytes = BIO_ctrl_pending(bio);
- if(ssl->loglevel) printf("sqCopyBioSSL: %d bytes pending; buffer size %d\n",
nbytes, dstLen);
- if(ssl->loglevel) printf("sqCopyBioSSL: %d bytes pending; buffer size %ld\n",
if(nbytes > dstLen) return -1; return BIO_read(bio, dstBuf, dstLen);nbytes, (long)dstLen);
} @@ -156,7 +156,7 @@ X509 *cert; sqSSL *ssl = sslFromHandle(handle);
- if(ssl->loglevel) printf("sqConnectSSL: %x\n", (int)ssl);
if(ssl->loglevel) printf("sqConnectSSL: %lx\n", (long)ssl);
/* Verify state of session */ if(ssl == NULL || (ssl->state != SQSSL_UNUSED && ssl->state != SQSSL_CONNECTING)) {
@@ -172,7 +172,7 @@ SSL_set_connect_state(ssl->ssl); }
- if(ssl->loglevel) printf("sqConnectSSL: BIO_write %d bytes\n", srcLen);
if(ssl->loglevel) printf("sqConnectSSL: BIO_write %ld bytes\n", (long)srcLen);
n = BIO_write(ssl->bioRead, srcBuf, srcLen);
@@ -202,7 +202,7 @@
if(ssl->loglevel) printf("sqConnectSSL: SSL_get_peer_certificate\n"); cert = SSL_get_peer_certificate(ssl->ssl);
- if(ssl->loglevel) printf("sqConnectSSL: cert = %x\n", (int)cert);
- if(ssl->loglevel) printf("sqConnectSSL: cert = %lx\n", (long)cert); /* Fail if no cert received. */ if(cert) { X509_NAME_get_text_by_NID(X509_get_subject_name(cert),
@@ -252,7 +252,7 @@ SSL_set_accept_state(ssl->ssl); }
- if(ssl->loglevel) printf("sqAcceptSSL: BIO_write %d bytes\n", srcLen);
if(ssl->loglevel) printf("sqAcceptSSL: BIO_write %ld bytes\n", (long)srcLen);
n = BIO_write(ssl->bioRead, srcBuf, srcLen);
@@ -286,7 +286,7 @@
if(ssl->loglevel) printf("sqAcceptSSL: SSL_get_peer_certificate\n"); cert = SSL_get_peer_certificate(ssl->ssl);
- if(ssl->loglevel) printf("sqAcceptSSL: cert = %x\n", (int)cert);
if(ssl->loglevel) printf("sqAcceptSSL: cert = %lx\n", (long)cert);
if(cert) { X509_NAME_get_text_by_NID(X509_get_subject_name(cert),
@@ -322,7 +322,7 @@
if(ssl == NULL || ssl->state != SQSSL_CONNECTED) return SQSSL_INVALID_STATE;
- if(ssl->loglevel) printf("sqEncryptSSL: Encrypting %d bytes\n", srcLen);
if(ssl->loglevel) printf("sqEncryptSSL: Encrypting %ld bytes\n", (long)srcLen);
nbytes = SSL_write(ssl->ssl, srcBuf, srcLen); if(nbytes != srcLen) return SQSSL_GENERIC_ERROR;
@@ -414,7 +414,7 @@ propID - the property id to retrieve Returns: The integer value of the property. */ -int sqGetIntPropertySSL(sqInt handle, int propID) { +sqInt sqGetIntPropertySSL(sqInt handle, sqInt propID) { sqSSL *ssl = sslFromHandle(handle);
if(ssl == NULL) return 0; @@ -424,7 +424,7 @@ case SQSSL_PROP_VERSION: return 1; case SQSSL_PROP_LOGLEVEL: return ssl->loglevel; default:
if(ssl->loglevel) printf("sqGetIntPropertySSL: Unknown property ID %d\n", propID);
} return 0;if(ssl->loglevel) printf("sqGetIntPropertySSL: Unknown property ID %ld\n", (long)propID); return 0;
@@ -444,7 +444,7 @@ switch(propID) { case SQSSL_PROP_LOGLEVEL: ssl->loglevel = propValue; break; default:
if(ssl->loglevel) printf("sqSetIntPropertySSL: Unknown property ID %d\n", propID);
} return 1;if(ssl->loglevel) printf("sqSetIntPropertySSL: Unknown property ID %ld\n", (long)propID); return 0;
Hi David,
you might look at latforms/unix/plugins/SqueakSSL/sqUnixOpenSSL.c in the Cog branch. It uses e.g.
if(ssl->loglevel) printf("sqAcceptSSL: cert = %p\n", cert);
instead of
if(ssl->loglevel) printf("sqAcceptSSL: cert = %lx\n", (long)cert);
which is preferrable, as cert is a pointer. The Cog version definitely compiles on 64-bit; I'm running a 64-bit Spur Stack VM regularly.
On Thu, Jan 29, 2015 at 4:37 PM, commits@squeakvm.org wrote:
Revision: 3238 Author: lewis Date: 2015-01-29 16:37:29 -0800 (Thu, 29 Jan 2015) Log Message:
Compile for 32 or 64 bit host or image, 4 or 8 byte sqInt, squeakvm or squeakvm64. Change signature of sqGetIntPropertySSL to match declaration in Cross/plugins/SqueakSSL/SqueakSSL.h For debug printing, cast sqInt to long and print with %ld to prevent warnings when sizeof(sqInt) is 8. Reference Mantis 7751 (http://bugs.squeak.org/view.php?id=7751)
Modified Paths:
trunk/platforms/unix/plugins/SqueakSSL/sqUnixOpenSSL.c
Modified: trunk/platforms/unix/plugins/SqueakSSL/sqUnixOpenSSL.c
--- trunk/platforms/unix/plugins/SqueakSSL/sqUnixOpenSSL.c 2015-01-29 22:46:44 UTC (rev 3237) +++ trunk/platforms/unix/plugins/SqueakSSL/sqUnixOpenSSL.c 2015-01-30 00:37:29 UTC (rev 3238) @@ -36,8 +36,8 @@ sqInt sqCopyBioSSL(sqSSL *ssl, BIO *bio, char *dstBuf, sqInt dstLen) { int nbytes = BIO_ctrl_pending(bio);
- if(ssl->loglevel) printf("sqCopyBioSSL: %d bytes pending; buffer size
%d\n",
nbytes, dstLen);
- if(ssl->loglevel) printf("sqCopyBioSSL: %d bytes pending; buffer size
%ld\n",
if(nbytes > dstLen) return -1; return BIO_read(bio, dstBuf, dstLen);nbytes, (long)dstLen);
} @@ -156,7 +156,7 @@ X509 *cert; sqSSL *ssl = sslFromHandle(handle);
if(ssl->loglevel) printf("sqConnectSSL: %x\n", (int)ssl);
if(ssl->loglevel) printf("sqConnectSSL: %lx\n", (long)ssl); /* Verify state of session */ if(ssl == NULL || (ssl->state != SQSSL_UNUSED && ssl->state !=
SQSSL_CONNECTING)) { @@ -172,7 +172,7 @@ SSL_set_connect_state(ssl->ssl); }
if(ssl->loglevel) printf("sqConnectSSL: BIO_write %d bytes\n",
srcLen);
if(ssl->loglevel) printf("sqConnectSSL: BIO_write %ld bytes\n",
(long)srcLen);
n = BIO_write(ssl->bioRead, srcBuf, srcLen);
@@ -202,7 +202,7 @@
if(ssl->loglevel) printf("sqConnectSSL:
SSL_get_peer_certificate\n"); cert = SSL_get_peer_certificate(ssl->ssl);
if(ssl->loglevel) printf("sqConnectSSL: cert = %x\n", (int)cert);
if(ssl->loglevel) printf("sqConnectSSL: cert = %lx\n", (long)cert); /* Fail if no cert received. */ if(cert) { X509_NAME_get_text_by_NID(X509_get_subject_name(cert),
@@ -252,7 +252,7 @@ SSL_set_accept_state(ssl->ssl); }
if(ssl->loglevel) printf("sqAcceptSSL: BIO_write %d bytes\n",
srcLen);
if(ssl->loglevel) printf("sqAcceptSSL: BIO_write %ld bytes\n",
(long)srcLen);
n = BIO_write(ssl->bioRead, srcBuf, srcLen);
@@ -286,7 +286,7 @@
if(ssl->loglevel) printf("sqAcceptSSL:
SSL_get_peer_certificate\n"); cert = SSL_get_peer_certificate(ssl->ssl);
if(ssl->loglevel) printf("sqAcceptSSL: cert = %x\n", (int)cert);
if(ssl->loglevel) printf("sqAcceptSSL: cert = %lx\n", (long)cert); if(cert) { X509_NAME_get_text_by_NID(X509_get_subject_name(cert),
@@ -322,7 +322,7 @@
if(ssl == NULL || ssl->state != SQSSL_CONNECTED) return
SQSSL_INVALID_STATE;
if(ssl->loglevel) printf("sqEncryptSSL: Encrypting %d bytes\n",
srcLen);
if(ssl->loglevel) printf("sqEncryptSSL: Encrypting %ld bytes\n",
(long)srcLen);
nbytes = SSL_write(ssl->ssl, srcBuf, srcLen); if(nbytes != srcLen) return SQSSL_GENERIC_ERROR;
@@ -414,7 +414,7 @@ propID - the property id to retrieve Returns: The integer value of the property. */ -int sqGetIntPropertySSL(sqInt handle, int propID) { +sqInt sqGetIntPropertySSL(sqInt handle, sqInt propID) { sqSSL *ssl = sslFromHandle(handle);
if(ssl == NULL) return 0;
@@ -424,7 +424,7 @@ case SQSSL_PROP_VERSION: return 1; case SQSSL_PROP_LOGLEVEL: return ssl->loglevel; default:
if(ssl->loglevel) printf("sqGetIntPropertySSL:
Unknown property ID %d\n", propID);
if(ssl->loglevel) printf("sqGetIntPropertySSL:
Unknown property ID %ld\n", (long)propID); return 0; } return 0; @@ -444,7 +444,7 @@ switch(propID) { case SQSSL_PROP_LOGLEVEL: ssl->loglevel = propValue; break; default:
if(ssl->loglevel) printf("sqSetIntPropertySSL:
Unknown property ID %d\n", propID);
if(ssl->loglevel) printf("sqSetIntPropertySSL:
Unknown property ID %ld\n", (long)propID); return 0; } return 1;
On Thu, Jan 29, 2015 at 05:31:02PM -0800, Eliot Miranda wrote:
Hi David,
you might look at latforms/unix/plugins/SqueakSSL/sqUnixOpenSSL.c in
the Cog branch. It uses e.g.
if(ssl->loglevel) printf("sqAcceptSSL: cert = %p\n", cert);
instead of
if(ssl->loglevel) printf("sqAcceptSSL: cert = %lx\n", (long)cert);
which is preferrable, as cert is a pointer. The Cog version definitely compiles on 64-bit; I'm running a 64-bit Spur Stack VM regularly.
Thanks, that looks much better, but:
/home/lewis/squeak/VM/platforms/unix/plugins/SqueakSSL/sqUnixOpenSSL.c:175:2: warning: format ‘%p’ expects argument of type ‘void *’, but argument 2 has type ‘sqInt’ [-Wformat=] if(ssl->loglevel) printf("sqConnectSSL: BIO_write %p bytes\n", srcLen); ^
So some further type declarations may be required.
The issue I was dealing with was sizeof(sqInt) == 8, but declaring pointers properly in both the slang and platforms code is probably also needed.
I will try to follow up in it this weekend.
Thanks, Dave
On Thu, Jan 29, 2015 at 5:57 PM, David T. Lewis lewis@mail.msen.com wrote:
On Thu, Jan 29, 2015 at 05:31:02PM -0800, Eliot Miranda wrote:
Hi David,
you might look at latforms/unix/plugins/SqueakSSL/sqUnixOpenSSL.c in
the Cog branch. It uses e.g.
if(ssl->loglevel) printf("sqAcceptSSL: cert = %p\n", cert);
instead of
if(ssl->loglevel) printf("sqAcceptSSL: cert = %lx\n", (long)cert);
which is preferrable, as cert is a pointer. The Cog version definitely compiles on 64-bit; I'm running a 64-bit Spur Stack VM regularly.
Thanks, that looks much better, but:
/home/lewis/squeak/VM/platforms/unix/plugins/SqueakSSL/sqUnixOpenSSL.c:175:2: warning: format ‘%p’ expects argument of type ‘void *’, but argument 2 has type ‘sqInt’ [-Wformat=] if(ssl->loglevel) printf("sqConnectSSL: BIO_write %p bytes\n", srcLen);
Thanks David, in Cog thsi now reads "printf("sqEncryptSSL: Encrypting %ld bytes\n", srcLen);"
^
So some further type declarations may be required.
The issue I was dealing with was sizeof(sqInt) == 8, but declaring pointers properly in both the slang and platforms code is probably also needed.
I will try to follow up in it this weekend.
Thanks, Dave
vm-dev@lists.squeakfoundation.org