tdf#130137 Replace remaining uses of WNT define checks with _WIN32
Change-Id: If95f1ea5a81de62eb4f725e5fcb30ccb8530062a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87372 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
This commit is contained in:
@@ -173,7 +173,7 @@ namespace
|
||||
|
||||
#if defined MACOSX
|
||||
const intptr_t id = reinterpret_cast<intptr_t>( pEnvData->mpNSView );
|
||||
#elif defined WNT
|
||||
#elif defined _WIN32
|
||||
const intptr_t id = reinterpret_cast<intptr_t>( pEnvData->hWnd );
|
||||
#else
|
||||
const intptr_t id = static_cast<intptr_t>( pEnvData->aWindow );
|
||||
|
||||
@@ -40,7 +40,7 @@ namespace { extern "C" {
|
||||
void ( *libvlc_media_player_set_xwindow ) ( libvlc_media_player_t *p_mi, uint32_t drawable );
|
||||
#elif defined MACOSX
|
||||
void ( *libvlc_media_player_set_nsobject ) ( libvlc_media_player_t *p_mi, void *drawable );
|
||||
#elif defined WNT
|
||||
#elif defined _WIN32
|
||||
void ( *libvlc_media_player_set_hwnd ) ( libvlc_media_player_t *p_mi, void *drawable );
|
||||
#else
|
||||
#error unknown OS
|
||||
@@ -83,7 +83,7 @@ namespace avmedia::vlc::wrapper
|
||||
SYM_MAP( libvlc_media_player_set_xwindow ),
|
||||
#elif defined MACOSX
|
||||
SYM_MAP( libvlc_media_player_set_nsobject ),
|
||||
#elif defined WNT
|
||||
#elif defined _WIN32
|
||||
SYM_MAP( libvlc_media_player_set_hwnd ),
|
||||
#endif
|
||||
SYM_MAP( libvlc_media_player_has_vout ),
|
||||
@@ -220,7 +220,7 @@ namespace avmedia::vlc::wrapper
|
||||
libvlc_media_player_set_xwindow( mPlayer, static_cast<uint32_t>(id) );
|
||||
#elif defined MACOSX
|
||||
libvlc_media_player_set_nsobject( mPlayer, reinterpret_cast<void*>( id ) );
|
||||
#elif defined WNT
|
||||
#elif defined _WIN32
|
||||
libvlc_media_player_set_hwnd( mPlayer, reinterpret_cast<void*>( id ) );
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ struct ApiMap
|
||||
const char LibName[] = "libvlc.so.5";
|
||||
#elif defined( MACOSX )
|
||||
const char LibName[] = "/Applications/VLC.app/Contents/MacOS/lib/libvlc.dylib";
|
||||
#elif defined( WNT )
|
||||
#elif defined( _WIN32 )
|
||||
const char LibName[] = "libvlc.dll";
|
||||
|
||||
inline OUString GetVLCPath()
|
||||
@@ -95,7 +95,7 @@ struct ApiMap
|
||||
{
|
||||
#if defined( LINUX ) || defined( MACOSX )
|
||||
OUString const fullPath(LibName);
|
||||
#elif defined( WNT )
|
||||
#elif defined( _WIN32 )
|
||||
OUString const fullPath(GetVLCPath() + LibName);
|
||||
#endif
|
||||
SAL_INFO("avmedia", fullPath);
|
||||
|
||||
@@ -612,7 +612,7 @@ Components::~Components()
|
||||
// (unknown yet) but can do no harm
|
||||
const bool bExitWasCalled(comphelper::BackupFileHelper::getExitWasCalled());
|
||||
|
||||
#ifndef WNT
|
||||
#ifndef _WIN32
|
||||
// we can add a SAL_WARN here for other systems where the destructor gets called after
|
||||
// an _exit() call. Still safe - the getExitWasCalled() is used, but a hint that _exit
|
||||
// behaves different on a system
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <shlobj.h>
|
||||
#include <objidl.h>
|
||||
#endif // End WNT
|
||||
#endif // End _WIN32
|
||||
#include <osl/security.hxx>
|
||||
#include <osl/file.hxx>
|
||||
#include <osl/thread.h>
|
||||
|
||||
@@ -1960,7 +1960,7 @@ void Desktop::OpenClients()
|
||||
+ utl::ConfigManager::getUILocale();
|
||||
#if defined UNX
|
||||
aHelpURL += "&System=UNX";
|
||||
#elif defined WNT
|
||||
#elif defined _WIN32
|
||||
aHelpURL += "&System=WIN";
|
||||
#endif
|
||||
Application::GetHelp()->Start(aHelpURL, static_cast<const vcl::Window*>(nullptr));
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
#include <fstream>
|
||||
#if defined( UNX ) && !defined MACOSX && !defined IOS && !defined ANDROID
|
||||
#include <client/linux/handler/exception_handler.h>
|
||||
#elif defined WNT
|
||||
#elif defined _WIN32
|
||||
#if defined __clang__
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wmicrosoft-enum-value"
|
||||
@@ -54,7 +54,7 @@ static bool dumpCallback(const google_breakpad::MinidumpDescriptor& descriptor,
|
||||
|
||||
return succeeded;
|
||||
}
|
||||
#elif defined WNT
|
||||
#elif defined _WIN32
|
||||
static bool dumpCallback(const wchar_t* path, const wchar_t* id,
|
||||
void* /*context*/, EXCEPTION_POINTERS* /*exinfo*/,
|
||||
MDRawAssertionInfo* /*assertion*/,
|
||||
@@ -176,7 +176,7 @@ void CrashReporter::updateMinidumpLocation()
|
||||
OString aOStringUrl = OUStringToOString(aURL, RTL_TEXTENCODING_UTF8);
|
||||
google_breakpad::MinidumpDescriptor descriptor(aOStringUrl.getStr());
|
||||
mpExceptionHandler->set_minidump_descriptor(descriptor);
|
||||
#elif defined WNT
|
||||
#elif defined _WIN32
|
||||
OUString aURL = getCrashDirectory();
|
||||
mpExceptionHandler->set_dump_path(o3tl::toW(aURL.getStr()));
|
||||
#endif
|
||||
@@ -208,7 +208,7 @@ void CrashReporter::installExceptionHandler()
|
||||
#if defined( UNX ) && !defined MACOSX && !defined IOS && !defined ANDROID
|
||||
google_breakpad::MinidumpDescriptor descriptor("/tmp");
|
||||
mpExceptionHandler = std::make_unique<google_breakpad::ExceptionHandler>(descriptor, nullptr, dumpCallback, nullptr, true, -1);
|
||||
#elif defined WNT
|
||||
#elif defined _WIN32
|
||||
mpExceptionHandler = std::make_unique<google_breakpad::ExceptionHandler>(L".", nullptr, dumpCallback, nullptr, google_breakpad::ExceptionHandler::HANDLER_ALL);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -1080,7 +1080,7 @@ bool IpcThread::process(OString const & arguments, bool * waitProcessed) {
|
||||
aHelpURLBuffer.append(utl::ConfigManager::getUILocale());
|
||||
#if defined UNX
|
||||
aHelpURLBuffer.append("&System=UNX");
|
||||
#elif defined WNT
|
||||
#elif defined _WIN32
|
||||
aHelpURLBuffer.append("&System=WIN");
|
||||
#endif
|
||||
ApplicationEvent* pAppEvent = new ApplicationEvent(
|
||||
|
||||
@@ -72,7 +72,7 @@ static const char kUserAgent[] = "LibreOffice UpdateChecker/1.0 (unknown platfor
|
||||
#ifdef UNX
|
||||
const char* const pUpdaterName = "updater";
|
||||
const char* const pSofficeExeName = "soffice";
|
||||
#elif defined(WNT)
|
||||
#elif defined(_WIN32)
|
||||
const char* pUpdaterName = "updater.exe";
|
||||
const char* pSofficeExeName = "soffice.exe";
|
||||
#else
|
||||
|
||||
@@ -30,9 +30,9 @@
|
||||
#endif
|
||||
#include <windows.h>
|
||||
#include <winldap.h>
|
||||
#else // !defined WNT
|
||||
#else // !defined _WIN32
|
||||
#include <ldap.h>
|
||||
#endif // WNT
|
||||
#endif // _WIN32
|
||||
|
||||
#include <com/sun/star/ldap/LdapGenericException.hpp>
|
||||
|
||||
|
||||
@@ -147,7 +147,7 @@ namespace basegfx
|
||||
*/
|
||||
inline double copySign(double fValue, double fSignCarrier)
|
||||
{
|
||||
#ifdef WNT
|
||||
#ifdef _WIN32
|
||||
return _copysign(fValue, fSignCarrier);
|
||||
#else
|
||||
return copysign(fValue, fSignCarrier);
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
#include <type_traits>
|
||||
|
||||
#ifdef DBG_UTIL
|
||||
#ifndef WNT
|
||||
#ifndef _WIN32
|
||||
#include <vcl/vclmain.hxx>
|
||||
#endif
|
||||
#endif
|
||||
@@ -100,7 +100,7 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
#if defined(DBG_UTIL) && !defined(WNT)
|
||||
#if defined(DBG_UTIL) && !defined(_WIN32)
|
||||
virtual ~VclPtr()
|
||||
{
|
||||
assert(m_rInnerRef.get() == nullptr || vclmain::isAlive());
|
||||
|
||||
@@ -40,7 +40,7 @@ public:
|
||||
delete this;
|
||||
}
|
||||
#ifdef DBG_UTIL
|
||||
#ifndef WNT
|
||||
#ifndef _WIN32
|
||||
sal_Int32 getRefCount() const { return mnRefCnt; }
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -644,7 +644,7 @@ static void addJavaInfoFromWinReg(
|
||||
}
|
||||
}
|
||||
|
||||
#endif // WNT
|
||||
#endif // _WIN32
|
||||
|
||||
void bubbleSortVersion(vector<rtl::Reference<VendorBase> >& vec)
|
||||
{
|
||||
@@ -760,7 +760,7 @@ vector<Reference<VendorBase> > addAllJREInfos(
|
||||
#if defined(_WIN32)
|
||||
// Get Javas from the registry
|
||||
addJavaInfoFromWinReg(allInfos, addedInfos);
|
||||
#endif // WNT
|
||||
#endif // _WIN32
|
||||
|
||||
if (checkJavaHomeAndPath) {
|
||||
addJavaInfoFromJavaHome(allInfos, addedInfos);
|
||||
|
||||
@@ -56,7 +56,7 @@ OString Win_AddLongPathPrefix( const OString &rPathName )
|
||||
if (!rPathName.match(WIN32_LONG_PATH_PREFIX)) return WIN32_LONG_PATH_PREFIX + rPathName;
|
||||
return rPathName;
|
||||
}
|
||||
#endif //defined(WNT)
|
||||
#endif //defined(_WIN32)
|
||||
|
||||
#ifdef SYSTEM_DICTS
|
||||
// find old style dictionaries in system directories
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
|
||||
#if defined(UNIX)
|
||||
# include <sys/types.h>
|
||||
#elif defined(WNT)
|
||||
#elif defined(_WIN32)
|
||||
# include <io.h>
|
||||
#endif
|
||||
|
||||
|
||||
@@ -345,4 +345,4 @@ UpdateProgressUI(float progress)
|
||||
{
|
||||
sProgress = progress; // 32-bit writes are atomic
|
||||
}
|
||||
#endif // WNT
|
||||
#endif // _WIN32
|
||||
|
||||
@@ -2158,7 +2158,7 @@ LaunchCallbackApp(const NS_tchar *workingDir,
|
||||
execv(argv[0], argv);
|
||||
#elif defined(MACOSX)
|
||||
LaunchChild(argc, (const char**)argv);
|
||||
#elif defined(WNT)
|
||||
#elif defined(_WIN32)
|
||||
// Do not allow the callback to run when running an update through the
|
||||
// service as session 0. The unelevated updater.exe will do the launching.
|
||||
if (!usingService)
|
||||
@@ -2365,7 +2365,7 @@ ProcessReplaceRequest()
|
||||
NS_tchar destDir[MAXPATHLEN];
|
||||
NS_tsnprintf(destDir, sizeof(destDir)/sizeof(destDir[0]),
|
||||
NS_T("%s/Contents"), gInstallDirPath);
|
||||
#elif defined(WNT)
|
||||
#elif defined(_WIN32)
|
||||
// Windows preserves the case of the file/directory names. We use the
|
||||
// GetLongPathName API in order to get the correct case for the directory
|
||||
// name, so that if the user has used a different case when launching the
|
||||
@@ -3828,7 +3828,7 @@ int NS_main(int argc, NS_tchar **argv)
|
||||
"directory: " LOG_S, DELETE_DIR));
|
||||
}
|
||||
}
|
||||
#endif /* WNT */
|
||||
#endif /* _WIN32 */
|
||||
|
||||
|
||||
#ifdef MACOSX
|
||||
|
||||
@@ -40,9 +40,9 @@ void *SimpleReferenceObject::operator new(std::size_t nSize,
|
||||
#if defined(_WIN32)
|
||||
return ::operator new(nSize);
|
||||
// WNT lacks a global nothrow operator new...
|
||||
#else // WNT
|
||||
#else // _WIN32
|
||||
return ::operator new(nSize, std::nothrow);
|
||||
#endif // WNT
|
||||
#endif // _WIN32
|
||||
}
|
||||
|
||||
void SimpleReferenceObject::operator delete(void * pPtr)
|
||||
@@ -54,9 +54,9 @@ void SimpleReferenceObject::operator delete(void * pPtr, std::nothrow_t const &)
|
||||
{
|
||||
#if defined(_WIN32)
|
||||
::operator delete(pPtr); // WNT lacks a global nothrow operator delete...
|
||||
#else // WNT
|
||||
#else // _WIN32
|
||||
::operator delete(pPtr, std::nothrow);
|
||||
#endif // WNT
|
||||
#endif // _WIN32
|
||||
}
|
||||
|
||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
||||
|
||||
@@ -67,7 +67,7 @@ void URITools::openURI(const OUString& sURI, bool bHandleSystemShellExecuteExcep
|
||||
|
||||
// tdf#116305 Workaround: Use timer to bring browsers to the front
|
||||
aOpenURITimer.SetInvokeHandler(LINK(this, URITools, onOpenURI));
|
||||
#ifdef WNT
|
||||
#ifdef _WIN32
|
||||
// 200ms seems to be the best compromise between responsiveness and success rate
|
||||
aOpenURITimer.SetTimeout(200);
|
||||
#else
|
||||
|
||||
@@ -145,7 +145,7 @@ class ShutdownIcon : public ShutdownIconServiceBase
|
||||
};
|
||||
|
||||
extern "C" {
|
||||
# ifdef WNT
|
||||
# ifdef _WIN32
|
||||
// builtin win32 systray
|
||||
void win32_init_sys_tray();
|
||||
void win32_shutdown_sys_tray();
|
||||
|
||||
@@ -50,7 +50,7 @@ void IncludesCollection::add_to_collection(const string& dirPath) {
|
||||
dirContent.insert(pent->d_name);
|
||||
}
|
||||
closedir(pdir);
|
||||
#endif // defined( WNT )
|
||||
#endif // defined( _WIN32 )
|
||||
allIncludes.insert(EntriesPair(dirPath, dirContent));
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ bool IncludesCollection::exists(string filePath) {
|
||||
[](char c) {
|
||||
return rtl::toAsciiLowerCase(static_cast<unsigned char>(c));
|
||||
});
|
||||
#endif // defined( WNT )
|
||||
#endif // defined( _WIN32 )
|
||||
PathFilePair dirFile = split_path(filePath);
|
||||
string dirPath = dirFile.first;
|
||||
string fileName = dirFile.second;
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
#include <algorithm>
|
||||
#else
|
||||
#include <dirent.h>
|
||||
#endif // defined( WNT )
|
||||
#endif // defined( _WIN32 )
|
||||
|
||||
#include <iostream>
|
||||
|
||||
|
||||
@@ -495,7 +495,7 @@ DECLARE_ODFEXPORT_TEST(testSenderInitials, "sender-initials.fodt")
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef WNT
|
||||
#ifndef _WIN32
|
||||
DECLARE_ODFEXPORT_TEST(testResolvedComment, "resolved-comment.odt")
|
||||
{
|
||||
// TODO find out why does this break testFdo58949 on Windows.
|
||||
|
||||
@@ -5887,7 +5887,7 @@ void SwUiWriterTest::testTdf107976()
|
||||
|
||||
void SwUiWriterTest::testTdf58604()
|
||||
{
|
||||
#ifdef WNT
|
||||
#ifdef _WIN32
|
||||
// Allow linebreak character follows hanging punctuation immediately instead of
|
||||
// breaking at the start of the next line.
|
||||
load(DATA_DIRECTORY, "tdf58604.odt");
|
||||
|
||||
@@ -1509,7 +1509,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testMixedFormFieldInsertion)
|
||||
|
||||
CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf124261)
|
||||
{
|
||||
#if !defined(WNT)
|
||||
#if !defined(_WIN32)
|
||||
// Make sure that pressing a key in a btlr cell frame causes an immediate, correct repaint.
|
||||
SwDoc* pDoc = createDoc("tdf124261.docx");
|
||||
SwRootFrame* pLayout = pDoc->getIDocumentLayoutAccess().GetCurrentLayout();
|
||||
|
||||
@@ -1742,7 +1742,7 @@ vcl::Window* VCLXToolkit::ImplCreateWindow( VCLXWindow** ppNewComp,
|
||||
#elif defined UNX
|
||||
aParentData.aWindow = nWindowHandle;
|
||||
aParentData.bXEmbedSupport = bXEmbed;
|
||||
#elif defined WNT
|
||||
#elif defined _WIN32
|
||||
aParentData.hWnd = reinterpret_cast<HWND>(nWindowHandle);
|
||||
#endif
|
||||
pNewWindow = VclPtr<WorkWindow>::Create( &aParentData );
|
||||
@@ -1993,7 +1993,7 @@ css::uno::Reference< css::awt::XWindowPeer > VCLXToolkit::createSystemChild( con
|
||||
#elif defined UNX
|
||||
aParentData.aWindow = nWindowHandle;
|
||||
aParentData.bXEmbedSupport = bXEmbed;
|
||||
#elif defined WNT
|
||||
#elif defined _WIN32
|
||||
aParentData.hWnd = reinterpret_cast<HWND>(nWindowHandle);
|
||||
#endif
|
||||
SolarMutexGuard aGuard;
|
||||
|
||||
@@ -364,7 +364,7 @@ void FileProvider::initProperties()
|
||||
|
||||
#if defined ( UNX )
|
||||
m_FileSystemNotation = FileSystemNotation::UNIX_NOTATION;
|
||||
#elif defined( WNT )
|
||||
#elif defined( _WIN32 )
|
||||
m_FileSystemNotation = FileSystemNotation::DOS_NOTATION;
|
||||
#else
|
||||
m_FileSystemNotation = FileSystemNotation::UNKNOWN_NOTATION;
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
|
||||
#ifdef UNX
|
||||
#include <unistd.h>
|
||||
#elif defined( WNT )
|
||||
#elif defined( _WIN32 )
|
||||
#include <process.h>
|
||||
#endif
|
||||
|
||||
@@ -336,7 +336,7 @@ static OUString CreateTempName_Impl( const OUString* pParent, bool bKeep, bool b
|
||||
static const OUString aPidString = OUString::number(pid);
|
||||
aEyeCatcher += aPidString;
|
||||
#endif
|
||||
#elif defined(WNT)
|
||||
#elif defined(_WIN32)
|
||||
static const int pid = _getpid();
|
||||
static const OUString aPidString = OUString::number(pid);
|
||||
aEyeCatcher += aPidString;
|
||||
|
||||
@@ -254,7 +254,7 @@ static OUString queryFile( Printer const * pPrinter )
|
||||
xFilePicker->appendFilter( "PostScript", "*.ps" );
|
||||
if( bPDF )
|
||||
xFilePicker->appendFilter( "Portable Document Format", "*.pdf" );
|
||||
#elif defined WNT
|
||||
#elif defined _WIN32
|
||||
(void)pPrinter;
|
||||
xFilePicker->appendFilter( "*.PRN", "*.prn" );
|
||||
#endif
|
||||
|
||||
@@ -1815,7 +1815,7 @@ VclPtr<vcl::Window> VclBuilder::makeObject(vcl::Window *pParent, const OString &
|
||||
VclPtr<MessageDialog> xDialog(VclPtr<MessageDialog>::Create(pParent, nBits));
|
||||
m_pParserState->m_aMessageDialogs.push_back(xDialog);
|
||||
xWindow = xDialog;
|
||||
#if defined WNT
|
||||
#if defined _WIN32
|
||||
xWindow->set_border_width(3);
|
||||
#else
|
||||
xWindow->set_border_width(12);
|
||||
|
||||
@@ -2196,7 +2196,7 @@ void MessageDialog::create_message_area()
|
||||
|
||||
void MessageDialog::create_owned_areas()
|
||||
{
|
||||
#if defined WNT
|
||||
#if defined _WIN32
|
||||
set_border_width(3);
|
||||
#else
|
||||
set_border_width(12);
|
||||
|
||||
Reference in New Issue
Block a user