#
# Based on community discussion at
# https://github.com/martinpaljak/M2Crypto/issues/60
#
diff --git a/SWIG/_lib.i b/SWIG/_lib.i
index 0d40698..c74e531 100644
--- a/SWIG/_lib.i
+++ b/SWIG/_lib.i
@@ -66,6 +66,8 @@ int ssl_verify_callback(int ok, X509_STORE_CTX *ctx) {
int cret;
int new_style_callback = 0, warning_raised_exception=0;
PyGILState_STATE gilstate;
+ PyObject *self = 0;
+ (void)self;
ssl = (SSL *)X509_STORE_CTX_get_app_data(ctx);
@@ -151,6 +153,8 @@ int ssl_verify_callback(int ok, X509_STORE_CTX *ctx) {
void ssl_info_callback(const SSL *s, int where, int ret) {
PyObject *argv, *retval, *_SSL;
PyGILState_STATE gilstate;
+ PyObject *self = 0;
+ (void)self;
gilstate = PyGILState_Ensure();
@@ -170,6 +174,8 @@ DH *ssl_set_tmp_dh_callback(SSL *ssl, int is_export, int keylength) {
PyObject *argv, *ret, *_ssl;
DH *dh;
PyGILState_STATE gilstate;
+ PyObject *self = 0;
+ (void)self;
gilstate = PyGILState_Ensure();
@@ -193,6 +199,8 @@ RSA *ssl_set_tmp_rsa_callback(SSL *ssl, int is_export, int keylength) {
PyObject *argv, *ret, *_ssl;
RSA *rsa;
PyGILState_STATE gilstate;
+ PyObject *self = 0;
+ (void)self;
gilstate = PyGILState_Ensure();
diff --git a/SWIG/_pkcs7.i b/SWIG/_pkcs7.i
index 22d791a..92b1aeb 100644
--- a/SWIG/_pkcs7.i
+++ b/SWIG/_pkcs7.i
@@ -157,6 +157,8 @@ PyObject *smime_read_pkcs7(BIO *bio) {
BIO *bcont = NULL;
PKCS7 *p7;
PyObject *tuple, *_p7, *_BIO;
+ PyObject *self = 0;
+ (void)self;
if (BIO_method_type(bio) == BIO_TYPE_MEM) {
/* OpenSSL FAQ explains that this is needed for mem BIO to return EOF,
--- M2Crypto-0.21.1/setup.py Sat Jan 15 13:10:06 2011
+++ M2Crypto-0.21.1.new/setup.py Sat Jan 15 13:10:06 2011
@@ -57,6 +57,7 @@
self.swig_opts.append('-includeall')
#self.swig_opts.append('-D__i386__') # Uncomment for early OpenSSL 0.9.7 versions, or on Fedora Core if build fails
#self.swig_opts.append('-DOPENSSL_NO_EC') # Try uncommenting if you can't build with EC disabled
+ self.swig_opts.append('-builtin')
self.include_dirs += [os.path.join(self.openssl, opensslIncludeDir),
os.path.join(os.getcwd(), 'SWIG')]