From: Ralf Haferkamp Date: Thu, 10 Nov 2011 15:24:46 +0000 (+0100) Subject: Fix compile problems with older gcc releases X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=7402cbb6f739d50365dc343f2941f8dcc582e79c;p=openldap Fix compile problems with older gcc releases --- diff --git a/contrib/ldapc++/examples/startTls.cpp b/contrib/ldapc++/examples/startTls.cpp index a1a69e647c..b51a31d33b 100644 --- a/contrib/ldapc++/examples/startTls.cpp +++ b/contrib/ldapc++/examples/startTls.cpp @@ -27,7 +27,7 @@ int main( int argc, char* argv[]){ tls.setOption( TlsOptions::REQUIRE_CERT, TlsOptions::DEMAND ); std::cout << " CaCertfile: " << tls.getStringOption( TlsOptions::CACERTFILE ) << std::endl; std::cout << " Require Cert: " << tls.getIntOption( TlsOptions::REQUIRE_CERT ) << std::endl; - + try { // 1. connect using global options LDAPAsynConnection l(uri); @@ -40,8 +40,8 @@ int main( int argc, char* argv[]){ } // 2. connect using connection specific option - l = LDAPAsynConnection(uri); - tls=l.getTlsOptions(); + LDAPAsynConnection l1(uri); + tls=l1.getTlsOptions(); std::cout << "Current connection specific settings:" << std::endl; std::cout << " CaCertfile: " << tls.getStringOption( TlsOptions::CACERTFILE) << std::endl; std::cout << " CaCertDir: " << tls.getStringOption( TlsOptions::CACERTDIR ) << std::endl; @@ -52,13 +52,13 @@ int main( int argc, char* argv[]){ std::cout << " CaCertDir: " << tls.getStringOption( TlsOptions::CACERTDIR ) << std::endl; std::cout << " Require Cert: " << tls.getIntOption( TlsOptions::REQUIRE_CERT ) << std::endl; try { - l.start_tls(); + l1.start_tls(); std::cout << "StartTLS successful." << std::endl; - l.unbind(); + l1.unbind(); } catch ( LDAPException e ) { std::cerr << e << std::endl; } - + // 3. and once again using the globals try { LDAPAsynConnection l2(uri); @@ -76,4 +76,4 @@ int main( int argc, char* argv[]){ } catch ( LDAPException e ) { std::cerr << e << std::endl; } -} +}