diff options
author | Fridrich Štrba <fridrich.strba@bluewin.ch> | 2012-07-16 12:44:48 +0200 |
---|---|---|
committer | Fridrich Štrba <fridrich.strba@bluewin.ch> | 2012-07-16 12:44:48 +0200 |
commit | 1d1e7313ab076c919ce1bd095bac07480cea392f (patch) | |
tree | 41201fc5d7cdb37b07257e0679120a480d524a50 /extensions | |
parent | 589f09363bbf70601d11c5656ed2273d154c674f (diff) |
Cast from const sal_Char* to const PCHAR on Windows
Change-Id: If77916c59c3752f166482e0b8929fda859fac2f4
Diffstat (limited to 'extensions')
-rw-r--r-- | extensions/source/config/ldap/ldapaccess.cxx | 12 | ||||
-rw-r--r-- | extensions/source/config/ldap/wrapldapinclude.hxx | 2 |
2 files changed, 8 insertions, 6 deletions
diff --git a/extensions/source/config/ldap/ldapaccess.cxx b/extensions/source/config/ldap/ldapaccess.cxx index 72d5bf798fe8..674ddc72d9ce 100644 --- a/extensions/source/config/ldap/ldapaccess.cxx +++ b/extensions/source/config/ldap/ldapaccess.cxx @@ -138,8 +138,8 @@ void LdapConnection::connectSimple() // Do the bind LdapErrCode retCode = ldap_simple_bind_s(mConnection, - mLdapDefinition.mAnonUser.getStr(), - mLdapDefinition.mAnonCredentials.getStr()) ; + CONST_PCHAR_CAST mLdapDefinition.mAnonUser.getStr(), + CONST_PCHAR_CAST mLdapDefinition.mAnonCredentials.getStr()) ; checkLdapReturnCode("SimpleBind", retCode, mConnection) ; } @@ -158,7 +158,7 @@ void LdapConnection::initConnection() if (mLdapDefinition.mPort == 0) mLdapDefinition.mPort = LDAP_PORT; - mConnection = ldap_init(mLdapDefinition.mServer.getStr(), + mConnection = ldap_init(CONST_PCHAR_CAST mLdapDefinition.mServer.getStr(), mLdapDefinition.mPort) ; if (mConnection == NULL) { @@ -185,7 +185,7 @@ void LdapConnection::initConnection() LdapMessageHolder result; LdapErrCode retCode = ldap_search_s(mConnection, - aUserDn.getStr(), + CONST_PCHAR_CAST aUserDn.getStr(), LDAP_SCOPE_BASE, "(objectclass=*)", 0, @@ -235,9 +235,9 @@ void LdapConnection::initConnection() attributes[0]= const_cast<sal_Char *>(LDAP_NO_ATTRS); attributes[1]= NULL; LdapErrCode retCode = ldap_search_s(mConnection, - mLdapDefinition.mBaseDN.getStr(), + CONST_PCHAR_CAST mLdapDefinition.mBaseDN.getStr(), LDAP_SCOPE_SUBTREE, - filter.makeStringAndClear().getStr(), attributes, 0, &result.msg) ; + CONST_PCHAR_CAST filter.makeStringAndClear().getStr(), attributes, 0, &result.msg) ; checkLdapReturnCode("FindUserDn", retCode,mConnection) ; rtl::OString userDn ; diff --git a/extensions/source/config/ldap/wrapldapinclude.hxx b/extensions/source/config/ldap/wrapldapinclude.hxx index 1b84b76e246d..9283790f678e 100644 --- a/extensions/source/config/ldap/wrapldapinclude.hxx +++ b/extensions/source/config/ldap/wrapldapinclude.hxx @@ -34,6 +34,7 @@ #ifdef WNT #include <windows.h> #include <winldap.h> +#define CONST_PCHAR_CAST (const PCHAR) #ifndef LDAP_API # define LDAP_API(rt) rt #endif @@ -44,6 +45,7 @@ # define LDAP_NO_ATTRS "1.1" #endif #else // !defined WNT +#define CONST_PCHAR_CAST #ifndef LDAP_INCLUDED #define LDAP_INCLUDED #include <ldap/ldap.h> |