Update of /cvsroot/mahogany/M/src/util
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18908/src/util
Modified Files:
ssl.cpp
Log Message:
fixed build with OpenSSL 0.9.7g which adds const to many prototypes (bug 912)
Index: ssl.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/util/ssl.cpp,v
retrieving revision 1.35
retrieving revision 1.36
diff -b -u -2 -r1.35 -r1.36
--- ssl.cpp 4 Oct 2004 12:30:23 -0000 1.35
+++ ssl.cpp 31 Aug 2005 21:51:48 -0000 1.36
@@ -45,7 +45,7 @@
#include <openssl/ssl.h>
+#include <openssl/opensslv.h>
// starting from 0.9.6a, OpenSSL uses void, as it should, instead of char
-#include <openssl/opensslv.h>
#if defined(OPENSSL_VERSION_NUMBER) && (OPENSSL_VERSION_NUMBER > 0x0090600fL)
#define ssl_data_t void *
@@ -60,4 +60,12 @@
#endif
+// starting from 0.9.7g OpenSSL has discovered const correctness (better late
+// than never)
+#if defined(OPENSSL_VERSION_NUMBER) && (OPENSSL_VERSION_NUMBER >= 0x0090707fL)
+ #define ssl_const const
+#else
+ #define ssl_const
+#endif
+
/* This is our interface to the library and auth_ssl.c in c-client
which are all in "C" */
@@ -103,15 +111,15 @@
SSL_DEF( int, SSL_read, (SSL *s,ssl_data_t buf,int num), (s, buf, num) );
SSL_DEF( int, SSL_write, (SSL *s,const ssl_data_t buf,int num), (s, buf, num)
);
-SSL_DEF( int, SSL_pending, (SSL *s), (s) );
+SSL_DEF( int, SSL_pending, (ssl_const SSL *s), (s) );
SSL_DEF( int, SSL_library_init, (void ), () );
SSL_DEF_VOID( SSL_load_error_strings, (void ), () );
SSL_DEF( SSL_CTX *,SSL_CTX_new, (SSL_METHOD *meth), (meth) );
-SSL_DEF( const char *, SSL_CIPHER_get_name, (SSL_CIPHER *c), (c) );
-SSL_DEF( int, SSL_CIPHER_get_bits, (SSL_CIPHER *c, int *alg_bits),
(c,alg_bits) );
-SSL_DEF( SSL_CIPHER *, SSL_get_current_cipher ,(SSL *s), (s) );
-SSL_DEF( int, SSL_get_fd, (SSL *s), (s) );
+SSL_DEF( const char *, SSL_CIPHER_get_name, (ssl_const SSL_CIPHER *c), (c) );
+SSL_DEF( int, SSL_CIPHER_get_bits, (ssl_const SSL_CIPHER *c, int *alg_bits),
(c,alg_bits) );
+SSL_DEF( SSL_CIPHER *, SSL_get_current_cipher ,(ssl_const SSL *s), (s) );
+SSL_DEF( int, SSL_get_fd, (ssl_const SSL *s), (s) );
SSL_DEF( int, SSL_set_fd, (SSL *s, int fd), (s, fd) );
-SSL_DEF( int, SSL_get_error, (SSL *s, int ret_code), (s, ret_code) );
-SSL_DEF( X509 *, SSL_get_peer_certificate, (SSL *s), (s) );
+SSL_DEF( int, SSL_get_error, (ssl_const SSL *s, int ret_code), (s, ret_code) );
+SSL_DEF( X509 *, SSL_get_peer_certificate, (ssl_const SSL *s), (s) );
SSL_DEF_VOID( RAND_seed, (const void *buf,int num), (buf, num) );
@@ -123,5 +131,5 @@
SSL_DEF_VOID( SSL_set_bio, (SSL *s, BIO *rbio,BIO *wbio), (s,rbio,wbio) );
SSL_DEF_VOID( SSL_set_connect_state, (SSL *s), (s) );
-SSL_DEF( int, SSL_state, (SSL *ssl), (ssl) );
+SSL_DEF( int, SSL_state, (ssl_const SSL *ssl), (ssl) );
SSL_DEF( long, SSL_ctrl, (SSL *ssl,int cmd, long larg, ssl_parg parg),
(ssl,cmd,larg,parg) );
SSL_DEF_VOID( ERR_load_crypto_strings, (void), () );
-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Mahogany-cvsupdates mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mahogany-cvsupdates