From 2087484c65a3d5e75a9e8ad116d11a4e13366219 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Tue, 16 Feb 2016 14:14:43 +0200 Subject: use consistent #define checks for the Windows platform stage 2 of replacing usage of various checks for the windows platform with the compiler-defined '_WIN32' macro In this stage we focus on replacing usage of the WIN macro Change-Id: Ie8a4a63198a6de96bd158ecd707dadafb9c8ea84 Reviewed-on: https://gerrit.libreoffice.org/22393 Tested-by: Jenkins Reviewed-by: Noel Grandin --- extensions/source/abpilot/typeselectionpage.cxx | 2 +- extensions/source/config/ldap/ldapaccess.cxx | 14 +++++++------- extensions/source/config/ldap/ldapaccess.hxx | 2 +- extensions/source/scanner/scanwin.cxx | 2 +- extensions/source/update/check/download.cxx | 2 +- extensions/source/update/check/updatecheck.cxx | 12 ++++++------ extensions/source/update/check/updatecheckconfig.cxx | 6 +++--- 7 files changed, 20 insertions(+), 20 deletions(-) (limited to 'extensions') diff --git a/extensions/source/abpilot/typeselectionpage.cxx b/extensions/source/abpilot/typeselectionpage.cxx index 1a2a56597136..66b5f82e03a9 100644 --- a/extensions/source/abpilot/typeselectionpage.cxx +++ b/extensions/source/abpilot/typeselectionpage.cxx @@ -70,7 +70,7 @@ namespace abp bool bHaveKab = false; bool bHaveMacab = false; -#if !defined WNT +#if !defined(_WIN32) Reference< XDriverManager2 > xManager = DriverManager::create( _pParent->getORB() ); diff --git a/extensions/source/config/ldap/ldapaccess.cxx b/extensions/source/config/ldap/ldapaccess.cxx index 206514c8a70e..3e03f2c4a34f 100644 --- a/extensions/source/config/ldap/ldapaccess.cxx +++ b/extensions/source/config/ldap/ldapaccess.cxx @@ -120,7 +120,7 @@ void LdapConnection::connectSimple() #ifdef LDAP_X_OPT_CONNECT_TIMEOUT // OpenLDAP doesn't support this and the func /* timeout is specified in milliseconds -> 4 seconds*/ int timeout = 4000; -#ifdef WNT +#ifdef _WIN32 ldap_set_optionW( mConnection, LDAP_X_OPT_CONNECT_TIMEOUT, &timeout ); @@ -132,7 +132,7 @@ void LdapConnection::connectSimple() #endif // Do the bind -#ifdef WNT +#ifdef _WIN32 LdapErrCode retCode = ldap_simple_bind_sW(mConnection, (PWCHAR) mLdapDefinition.mAnonUser.getStr(), (PWCHAR) mLdapDefinition.mAnonCredentials.getStr() ); @@ -159,7 +159,7 @@ void LdapConnection::initConnection() if (mLdapDefinition.mPort == 0) mLdapDefinition.mPort = LDAP_PORT; -#ifdef WNT +#ifdef _WIN32 mConnection = ldap_initW((PWCHAR) mLdapDefinition.mServer.getStr(), mLdapDefinition.mPort) ; #else @@ -189,7 +189,7 @@ void LdapConnection::initConnection() OUString aUserDn =findUserDn( aUser ); LdapMessageHolder result; -#ifdef WNT +#ifdef _WIN32 LdapErrCode retCode = ldap_search_sW(mConnection, (PWCHAR) aUserDn.getStr(), LDAP_SCOPE_BASE, @@ -209,7 +209,7 @@ void LdapConnection::initConnection() checkLdapReturnCode("getUserProfile", retCode,mConnection) ; BerElement * ptr; -#ifdef WNT +#ifdef _WIN32 PWCHAR attr = ldap_first_attributeW(mConnection, result.msg, &ptr); while (attr) { PWCHAR * values = ldap_get_valuesW(mConnection, result.msg, attr); @@ -257,7 +257,7 @@ void LdapConnection::initConnection() filter.append( mLdapDefinition.mUserUniqueAttr ).append("=").append(aUser).append("))") ; LdapMessageHolder result; -#ifdef WNT +#ifdef _WIN32 PWCHAR attributes [2] = { const_cast( L"1.1" ), NULL }; LdapErrCode retCode = ldap_search_sW(mConnection, (PWCHAR) mLdapDefinition.mBaseDN.getStr(), @@ -276,7 +276,7 @@ void LdapConnection::initConnection() if (entry != nullptr) { -#ifdef WNT +#ifdef _WIN32 PWCHAR charsDn = ldap_get_dnW(mConnection, entry) ; userDn = OUString( reinterpret_cast( charsDn ) ); diff --git a/extensions/source/config/ldap/ldapaccess.hxx b/extensions/source/config/ldap/ldapaccess.hxx index d8fe63c5543c..ca206acce9ba 100644 --- a/extensions/source/config/ldap/ldapaccess.hxx +++ b/extensions/source/config/ldap/ldapaccess.hxx @@ -24,7 +24,7 @@ #include -#ifdef WNT +#ifdef _WIN32 #include #include #else // !defined WNT diff --git a/extensions/source/scanner/scanwin.cxx b/extensions/source/scanner/scanwin.cxx index 4c8858f5a216..009fec29eba0 100644 --- a/extensions/source/scanner/scanwin.cxx +++ b/extensions/source/scanner/scanwin.cxx @@ -61,7 +61,7 @@ using namespace ::com::sun::star; #define FIXTODOUBLE( nFix ) ((double)nFix.Whole+(double)nFix.Frac/65536.) #define FIXTOLONG( nFix ) ((long)floor(FIXTODOUBLE(nFix)+0.5)) -#if defined WNT +#if defined(_WIN32) #define TWAIN_LIBNAME "TWAIN_32.DLL" #define TWAIN_FUNCNAME "DSM_Entry" #endif diff --git a/extensions/source/update/check/download.cxx b/extensions/source/update/check/download.cxx index bb485b52b2c3..e2046f9b2ef7 100644 --- a/extensions/source/update/check/download.cxx +++ b/extensions/source/update/check/download.cxx @@ -18,7 +18,7 @@ */ -#if defined WNT +#if defined(_WIN32) # ifdef _MSC_VER # pragma warning(push, 1) /* disable warnings within system headers */ # endif diff --git a/extensions/source/update/check/updatecheck.cxx b/extensions/source/update/check/updatecheck.cxx index 0a813fc9a02f..74221ea0ddc2 100644 --- a/extensions/source/update/check/updatecheck.cxx +++ b/extensions/source/update/check/updatecheck.cxx @@ -42,7 +42,7 @@ #include #include -#ifdef WNT +#ifdef _WIN32 #ifdef _MSC_VER #pragma warning(push,1) // disable warnings within system headers //#pragma warning(disable: 4917) @@ -70,7 +70,7 @@ namespace uno = com::sun::star::uno ; #define PROPERTY_CLICK_HDL "MenuClickHDL" #define PROPERTY_SHOW_MENUICON "MenuIconVisible" -#if defined WNT +#if defined(_WIN32) extern "C" bool SAL_CALL WNT_hasInternetConnection(); #endif @@ -124,7 +124,7 @@ inline bool isObsoleteUpdateInfo(const OUString& rBuildId) OUString getImageFromFileName(const OUString& aFile) { -#ifndef WNT +#ifndef _WIN32 OUString aUnpackPath; if( osl_getExecutableFile(&aUnpackPath.pData) == osl_Process_E_None ) { @@ -247,7 +247,7 @@ private: /* Used to avoid dialup login windows (on platforms we know how to double this) */ static inline bool hasInternetConnection() { -#ifdef WNT +#ifdef _WIN32 return WNT_hasInternetConnection(); #else return true; @@ -604,7 +604,7 @@ DownloadThread::run() { osl_setThreadName("DownloadThread"); -#ifdef WNT +#ifdef _WIN32 CoUninitialize(); CoInitialize( NULL ); #endif @@ -1461,7 +1461,7 @@ UpdateCheck::storeReleaseNote(sal_Int8 nNum, const OUString &rURL) sal_uInt64 nWritten = 0; OUString aURL( rURL ); -#ifdef WNT +#ifdef _WIN32 rc = aFile.write( aLineBuf.getStr(), aLineBuf.getLength(), nWritten ); if ( rc != osl::FileBase::E_None ) return false; aURL = "URL=" + rURL; diff --git a/extensions/source/update/check/updatecheckconfig.cxx b/extensions/source/update/check/updatecheckconfig.cxx index 60aa6a7a4c52..4392cbf3a391 100644 --- a/extensions/source/update/check/updatecheckconfig.cxx +++ b/extensions/source/update/check/updatecheckconfig.cxx @@ -29,7 +29,7 @@ #include #include -#ifdef WNT +#ifdef _WIN32 #ifdef _MSC_VER #pragma warning(push,1) // disable warnings within system headers #pragma warning(disable: 4917) @@ -164,7 +164,7 @@ OUString UpdateCheckConfig::getDesktopDirectory() { OUString aRet; -#ifdef WNT +#ifdef _WIN32 WCHAR szPath[MAX_PATH]; if (TRUE == SHGetSpecialFolderPathW(nullptr, szPath, CSIDL_DESKTOPDIRECTORY, true)) @@ -191,7 +191,7 @@ OUString UpdateCheckConfig::getAllUsersDirectory() { OUString aRet; -#ifdef WNT +#ifdef _WIN32 WCHAR szPath[MAX_PATH]; if (TRUE == SHGetSpecialFolderPathW(nullptr, szPath, CSIDL_COMMON_DOCUMENTS, true)) -- cgit