diff options
author | Noel Grandin <noel@peralex.com> | 2016-02-16 14:14:43 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2016-02-17 11:33:57 +0000 |
commit | 2087484c65a3d5e75a9e8ad116d11a4e13366219 (patch) | |
tree | 1f335918a854319df9269329d165a91d711d2108 /extensions | |
parent | d6bf086012343b4a1e27cd4242dced9ee0d73a06 (diff) |
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 <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'extensions')
-rw-r--r-- | extensions/source/abpilot/typeselectionpage.cxx | 2 | ||||
-rw-r--r-- | extensions/source/config/ldap/ldapaccess.cxx | 14 | ||||
-rw-r--r-- | extensions/source/config/ldap/ldapaccess.hxx | 2 | ||||
-rw-r--r-- | extensions/source/scanner/scanwin.cxx | 2 | ||||
-rw-r--r-- | extensions/source/update/check/download.cxx | 2 | ||||
-rw-r--r-- | extensions/source/update/check/updatecheck.cxx | 12 | ||||
-rw-r--r-- | extensions/source/update/check/updatecheckconfig.cxx | 6 |
7 files changed, 20 insertions, 20 deletions
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<PWCHAR>( 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<const sal_Unicode*>( 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 <map> -#ifdef WNT +#ifdef _WIN32 #include <windows.h> #include <winldap.h> #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 <osl/file.hxx> #include <sal/macros.h> -#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 <osl/file.hxx> #include <sal/macros.h> -#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)) |