From d98a58c543948d84d9287e6fa53a5539d662b7a5 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 4 Mar 2012 00:29:31 +0000 Subject: [PATCH] Use __WINDOWS__ for OS kind checks and reserve __WXMSW__ for GUI toolkit. This change prepares the way for using wxGTK under Windows as this would still define __WINDOWS__ but use __WXGTK__ instead of __WXMSW__. Closes #14064. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70796 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- docs/doxygen/mainpages/const_cpp.h | 11 +++++----- include/wx/datetime.h | 8 ++++---- include/wx/dynlib.h | 16 +++++++-------- include/wx/filefn.h | 2 +- include/wx/filename.h | 2 +- include/wx/fswatcher.h | 2 +- include/wx/intl.h | 12 +++++------ include/wx/iosfwrap.h | 2 +- include/wx/ioswrap.h | 2 +- include/wx/ipc.h | 2 +- include/wx/log.h | 4 ++-- include/wx/math.h | 2 +- include/wx/memory.h | 4 ++-- include/wx/power.h | 2 +- include/wx/private/fswatcher.h | 2 +- include/wx/private/sckaddr.h | 2 +- include/wx/private/socket.h | 6 +++--- include/wx/private/wxprintf.h | 4 ++-- include/wx/sound.h | 2 +- include/wx/stackwalk.h | 2 +- include/wx/stdpaths.h | 2 +- include/wx/string.h | 2 +- include/wx/thread.h | 6 +++--- include/wx/thrimpl.cpp | 4 ++-- include/wx/tls.h | 2 +- include/wx/utils.h | 10 +++++----- src/common/appbase.cpp | 20 +++++++++---------- src/common/config.cpp | 18 ++++++++--------- src/common/datetime.cpp | 6 +++--- src/common/datetimefmt.cpp | 4 ++-- src/common/dummy.cpp | 2 +- src/common/dynlib.cpp | 8 ++++---- src/common/encconv.cpp | 2 +- src/common/evtloopcmn.cpp | 4 ++-- src/common/file.cpp | 6 +++--- src/common/fileconf.cpp | 2 +- src/common/filefn.cpp | 32 +++++++++++++++--------------- src/common/filename.cpp | 18 ++++++++--------- src/common/filesys.cpp | 2 +- src/common/fmapbase.cpp | 2 +- src/common/init.cpp | 12 +++++------ src/common/intl.cpp | 22 ++++++++++---------- src/common/log.cpp | 16 +++++++-------- src/common/memory.cpp | 14 ++++++------- src/common/mimecmn.cpp | 22 ++++++++++---------- src/common/powercmn.cpp | 2 +- src/common/sckaddr.cpp | 4 ++-- src/common/stopwatch.cpp | 18 ++++++++--------- src/common/string.cpp | 4 ++-- src/common/time.cpp | 8 ++++---- src/common/translation.cpp | 2 +- src/common/txtstrm.cpp | 4 ++-- src/common/utilscmn.cpp | 12 +++++------ src/common/zstream.cpp | 2 +- src/msw/mimetype.cpp | 2 +- 55 files changed, 192 insertions(+), 193 deletions(-) diff --git a/docs/doxygen/mainpages/const_cpp.h b/docs/doxygen/mainpages/const_cpp.h index ad7a04d0e6..ea97707bdd 100644 --- a/docs/doxygen/mainpages/const_cpp.h +++ b/docs/doxygen/mainpages/const_cpp.h @@ -32,10 +32,6 @@ always tested using @ifdef_ and not @if_. @section page_cppconst_guisystem GUI system @beginDefList -@itemdef{__WINDOWS__, any Windows, you may also use __WXMSW__} -@itemdef{__WIN16__, Win16 API (not supported since wxWidgets 2.6)} -@itemdef{__WIN32__, Win32 API} -@itemdef{__WIN64__, Win64 (mostly same as Win32 but data type sizes are different)} @itemdef{__WXBASE__, Only wxBase, no GUI features (same as @c wxUSE_GUI == 0)} @itemdef{__WXCOCOA__, OS X using wxCocoa Port} @itemdef{__WXDFB__, wxUniversal using DirectFB} @@ -49,7 +45,7 @@ always tested using @ifdef_ and not @if_. @itemdef{__WXMAC__, old define for Mac OS X} @itemdef{__WXMOTIF__, Motif} @itemdef{__WXMOTIF20__, Motif 2.0 or higher} -@itemdef{__WXMSW__, Any Windows} +@itemdef{__WXMSW__, GUI using Windows Controls} @itemdef{__WXOSX__, any OS X} @itemdef{__WXOSX_IPHONE__, OS X iPhone} @itemdef{__WXOSX_CARBON__, Mac OS X using Carbon} @@ -112,7 +108,10 @@ symbols, although this has not always been followed. @itemdef{__UNIX__, any Unix} @itemdef{__UNIX_LIKE__, Unix, BeOS or VMS} @itemdef{__VMS__, VMS} -@itemdef{__WINDOWS__, any Windows} +@itemdef{__WINDOWS__, Any Windows platform, using any port (see also @c __WXMSW__)} +@itemdef{__WIN16__, Win16 API (not supported since wxWidgets 2.6)} +@itemdef{__WIN32__, Win32 API} +@itemdef{__WIN64__, Win64 (mostly same as Win32 but data type sizes are different)} @itemdef{__WINE__, Wine} @itemdef{_WIN32_WCE, Windows CE version} @endDefList diff --git a/include/wx/datetime.h b/include/wx/datetime.h index e8c1ac3120..1115e00f07 100644 --- a/include/wx/datetime.h +++ b/include/wx/datetime.h @@ -31,7 +31,7 @@ class WXDLLIMPEXP_FWD_BASE wxDateTime; class WXDLLIMPEXP_FWD_BASE wxTimeSpan; class WXDLLIMPEXP_FWD_BASE wxDateSpan; -#ifdef __WXMSW__ +#ifdef __WINDOWS__ struct _SYSTEMTIME; #endif @@ -606,7 +606,7 @@ public: wxDateTime_t minute = 0, wxDateTime_t second = 0, wxDateTime_t millisec = 0); -#ifdef __WXMSW__ +#ifdef __WINDOWS__ wxDateTime(const struct _SYSTEMTIME& st) { SetFromMSWSysTime(st); @@ -928,7 +928,7 @@ public: // SYSTEMTIME format // ------------------------------------------------------------------------ -#ifdef __WXMSW__ +#ifdef __WINDOWS__ // convert SYSTEMTIME to wxDateTime wxDateTime& SetFromMSWSysTime(const struct _SYSTEMTIME& st); @@ -938,7 +938,7 @@ public: // same as above but only take date part into account, time is always zero wxDateTime& SetFromMSWSysDate(const struct _SYSTEMTIME& st); void GetAsMSWSysDate(struct _SYSTEMTIME* st) const; -#endif // __WXMSW__ +#endif // __WINDOWS__ // comparison (see also functions below for operator versions) // ------------------------------------------------------------------------ diff --git a/include/wx/dynlib.h b/include/wx/dynlib.h index a5f60686cf..6a704d7eb6 100644 --- a/include/wx/dynlib.h +++ b/include/wx/dynlib.h @@ -123,14 +123,14 @@ enum wxPluginCategory #define wxDL_INIT_FUNC(pfx, name, dynlib) \ pfx ## name = (name ## _t)(dynlib).RawGetSymbol(#name) -#ifdef __WXMSW__ +#ifdef __WINDOWS__ // same as wxDL_INIT_FUNC() but appends 'A' or 'W' to the function name, see // wxDynamicLibrary::GetSymbolAorW() #define wxDL_INIT_FUNC_AW(pfx, name, dynlib) \ pfx ## name = (name ## _t)(dynlib).GetSymbolAorW(#name) -#endif // __WXMSW__ +#endif // __WINDOWS__ // the following macros can be used to redirect a whole library to a class and // check at run-time if the library is present and contains all required @@ -304,7 +304,7 @@ public: #endif } -#ifdef __WXMSW__ +#ifdef __WINDOWS__ // this function is useful for loading functions from the standard Windows // DLLs: such functions have an 'A' (in ANSI build) or 'W' (in Unicode, or // wide character build) suffix if they take string parameters @@ -326,7 +326,7 @@ public: { return RawGetSymbolAorW(m_handle, name); } -#endif // __WXMSW__ +#endif // __WINDOWS__ // return all modules/shared libraries in the address space of this process // @@ -349,7 +349,7 @@ public: static wxString GetPluginsDirectory(); -#ifdef __WXMSW__ +#ifdef __WINDOWS__ // return the handle (HMODULE/HINSTANCE) of the DLL with the given name // and/or containing the specified address: for XP and later systems only // the address is used and the name is ignored but for the previous systems @@ -360,7 +360,7 @@ public: // need to be freed using FreeLibrary() but it also means that it can // become invalid if the DLL is unloaded static WXHMODULE MSWGetModuleHandle(const char *name, void *addr); -#endif // __WXMSW__ +#endif // __WINDOWS__ protected: // common part of GetSymbol() and HasSymbol() @@ -383,7 +383,7 @@ protected: wxDECLARE_NO_COPY_CLASS(wxDynamicLibrary); }; -#ifdef __WXMSW__ +#ifdef __WINDOWS__ // ---------------------------------------------------------------------------- // wxLoadedDLL is a MSW-only internal helper class allowing to dynamically bind @@ -404,7 +404,7 @@ public: } }; -#endif // __WXMSW__ +#endif // __WINDOWS__ // ---------------------------------------------------------------------------- // Interesting defines diff --git a/include/wx/filefn.h b/include/wx/filefn.h index bad7a88aff..a10d97ce11 100644 --- a/include/wx/filefn.h +++ b/include/wx/filefn.h @@ -200,7 +200,7 @@ enum wxPosixPermissions #define wxCRT_RmDir _wrmdir #define wxCRT_Stat _wstat #define wxStructStat struct _stat -#elif (defined(__WXMSW__) || defined(__OS2__)) && \ +#elif (defined(__WINDOWS__) || defined(__OS2__)) && \ ( \ defined(__VISUALC__) || \ defined(__MINGW64__) || \ diff --git a/include/wx/filename.h b/include/wx/filename.h index dc8eb3020d..b351bf4d7e 100644 --- a/include/wx/filename.h +++ b/include/wx/filename.h @@ -40,7 +40,7 @@ class WXDLLIMPEXP_FWD_BASE wxFFile; // this symbol is defined for the platforms where file systems use volumes in // paths -#if defined(__WXMSW__) || defined(__DOS__) || defined(__OS2__) +#if defined(__WINDOWS__) || defined(__DOS__) || defined(__OS2__) #define wxHAS_FILESYSTEM_VOLUMES #endif diff --git a/include/wx/fswatcher.h b/include/wx/fswatcher.h index ff856722c1..959bcf8a8a 100644 --- a/include/wx/fswatcher.h +++ b/include/wx/fswatcher.h @@ -341,7 +341,7 @@ protected: #elif defined(wxHAS_KQUEUE) #include "wx/unix/fswatcher_kqueue.h" #define wxFileSystemWatcher wxKqueueFileSystemWatcher -#elif defined(__WXMSW__) +#elif defined(__WINDOWS__) #include "wx/msw/fswatcher.h" #define wxFileSystemWatcher wxMSWFileSystemWatcher #else diff --git a/include/wx/intl.h b/include/wx/intl.h index 418ad3ea00..d38f50b989 100644 --- a/include/wx/intl.h +++ b/include/wx/intl.h @@ -60,17 +60,17 @@ struct WXDLLIMPEXP_BASE wxLanguageInfo { int Language; // wxLanguage id wxString CanonicalName; // Canonical name, e.g. fr_FR -#ifdef __WXMSW__ +#ifdef __WINDOWS__ wxUint32 WinLang, // Win32 language identifiers WinSublang; -#endif // __WXMSW__ +#endif // __WINDOWS__ wxString Description; // human-readable name of the language wxLayoutDirection LayoutDirection; -#ifdef __WXMSW__ +#ifdef __WINDOWS__ // return the LCID corresponding to this language wxUint32 GetLCID() const; -#endif // __WXMSW__ +#endif // __WINDOWS__ // return the locale name corresponding to this language usable with // setlocale() on the current system @@ -79,9 +79,9 @@ struct WXDLLIMPEXP_BASE wxLanguageInfo // for Unix systems GetLocaleName() is trivial so implement it inline here, for // MSW it's implemented in intl.cpp -#ifndef __WXMSW__ +#ifndef __WINDOWS__ inline wxString wxLanguageInfo::GetLocaleName() const { return CanonicalName; } -#endif // !__WXMSW__ +#endif // !__WINDOWS__ // ---------------------------------------------------------------------------- diff --git a/include/wx/iosfwrap.h b/include/wx/iosfwrap.h index 78ad8d53b7..0b90119bdb 100644 --- a/include/wx/iosfwrap.h +++ b/include/wx/iosfwrap.h @@ -18,7 +18,7 @@ # include #endif -#ifdef __WXMSW__ +#ifdef __WINDOWS__ # include "wx/msw/winundef.h" #endif diff --git a/include/wx/ioswrap.h b/include/wx/ioswrap.h index 72dee5bbaa..7391683a74 100644 --- a/include/wx/ioswrap.h +++ b/include/wx/ioswrap.h @@ -21,7 +21,7 @@ #include "wx/afterstd.h" -#ifdef __WXMSW__ +#ifdef __WINDOWS__ # include "wx/msw/winundef.h" #endif diff --git a/include/wx/ipc.h b/include/wx/ipc.h index 5b6369235a..5b4b749895 100644 --- a/include/wx/ipc.h +++ b/include/wx/ipc.h @@ -16,7 +16,7 @@ // 0, or if the platform is not Windows, use TCP/IP for IPC implementation #if !defined(wxUSE_DDE_FOR_IPC) - #ifdef __WXMSW__ + #ifdef __WINDOWS__ #define wxUSE_DDE_FOR_IPC 1 #else #define wxUSE_DDE_FOR_IPC 0 diff --git a/include/wx/log.h b/include/wx/log.h index 6cbf62540d..90dde5e6b4 100644 --- a/include/wx/log.h +++ b/include/wx/log.h @@ -29,7 +29,7 @@ typedef unsigned long wxLogLevel; #define wxTraceResAlloc 0x0004 // trace GDI resource allocation #define wxTraceRefCount 0x0008 // trace various ref counting operations - #ifdef __WXMSW__ + #ifdef __WINDOWS__ #define wxTraceOleCalls 0x0100 // OLE interface calls #endif @@ -128,7 +128,7 @@ enum wxLogLevelValues #define wxTRACE_ResAlloc wxT("resalloc") // trace GDI resource allocation #define wxTRACE_RefCount wxT("refcount") // trace various ref counting operations -#ifdef __WXMSW__ +#ifdef __WINDOWS__ #define wxTRACE_OleCalls wxT("ole") // OLE interface calls #endif diff --git a/include/wx/math.h b/include/wx/math.h index 7de104caec..38b444e2df 100644 --- a/include/wx/math.h +++ b/include/wx/math.h @@ -128,7 +128,7 @@ #endif /* __cplusplus */ -#if defined(__WXMSW__) && !defined(__WXWINCE__) +#if defined(__WINDOWS__) && !defined(__WXWINCE__) #define wxMulDivInt32( a , b , c ) ::MulDiv( a , b , c ) #else #define wxMulDivInt32( a , b , c ) (wxRound((a)*(((wxDouble)b)/((wxDouble)c)))) diff --git a/include/wx/memory.h b/include/wx/memory.h index 1bece9a2d7..ede7380a6c 100644 --- a/include/wx/memory.h +++ b/include/wx/memory.h @@ -60,7 +60,7 @@ WXDLLIMPEXP_BASE void wxDebugFree(void * buf, bool isVect = false); // devik 2000-8-29: All new/delete ops are now inline because they can't // be marked as dllexport/dllimport. It then leads to weird bugs when // used on MSW as DLL -#if defined(__WXMSW__) && (defined(WXUSINGDLL) || defined(WXMAKINGDLL_BASE)) +#if defined(__WINDOWS__) && (defined(WXUSINGDLL) || defined(WXMAKINGDLL_BASE)) inline void * operator new (size_t size, wxChar * fileName, int lineNum) { return wxDebugAlloc(size, fileName, lineNum, false, false); @@ -108,7 +108,7 @@ void * operator new[] (size_t size, wxChar * fileName, int lineNum); void operator delete[] (void * buf); #endif // wxUSE_ARRAY_MEMORY_OPERATORS -#endif // defined(__WXMSW__) && (defined(WXUSINGDLL) || defined(WXMAKINGDLL_BASE)) +#endif // defined(__WINDOWS__) && (defined(WXUSINGDLL) || defined(WXMAKINGDLL_BASE)) // VC++ 6.0 and MWERKS #if ( defined(__VISUALC__) && (__VISUALC__ >= 1200) ) || defined(__MWERKS__) diff --git a/include/wx/power.h b/include/wx/power.h index bae6406482..e55cd60bcc 100644 --- a/include/wx/power.h +++ b/include/wx/power.h @@ -42,7 +42,7 @@ enum wxBatteryState // compiling in the code for handling them which is never going to be invoked // under the other platforms, we define wxHAS_POWER_EVENTS symbol if this event // is available, it should be used to guard all code using wxPowerEvent -#ifdef __WXMSW__ +#ifdef __WINDOWS__ #define wxHAS_POWER_EVENTS diff --git a/include/wx/private/fswatcher.h b/include/wx/private/fswatcher.h index d10b4036da..e106e6c926 100644 --- a/include/wx/private/fswatcher.h +++ b/include/wx/private/fswatcher.h @@ -23,7 +23,7 @@ #define wxFSWatchEntry wxFSWatchEntryKq WX_DECLARE_STRING_HASH_MAP(wxSharedPtr,wxFSWatchEntries); #include "wx/unix/private/fswatcher_kqueue.h" -#elif defined(__WXMSW__) +#elif defined(__WINDOWS__) class wxFSWatchEntryMSW; #define wxFSWatchEntry wxFSWatchEntryMSW WX_DECLARE_STRING_HASH_MAP(wxSharedPtr,wxFSWatchEntries); diff --git a/include/wx/private/sckaddr.h b/include/wx/private/sckaddr.h index 2ad7b6b2df..bb6b30c679 100644 --- a/include/wx/private/sckaddr.h +++ b/include/wx/private/sckaddr.h @@ -11,7 +11,7 @@ #ifndef _WX_PRIVATE_SOCKADDR_H_ #define _WX_PRIVATE_SOCKADDR_H_ -#ifdef __WXMSW__ +#ifdef __WINDOWS__ #include "wx/msw/wrapwin.h" #if wxUSE_IPV6 diff --git a/include/wx/private/socket.h b/include/wx/private/socket.h index 89a5bd0004..3e934663a1 100644 --- a/include/wx/private/socket.h +++ b/include/wx/private/socket.h @@ -61,7 +61,7 @@ // include the header defining timeval: under Windows this struct is used only // with sockets so we need to include winsock.h which we do via windows.h -#ifdef __WXMSW__ +#ifdef __WINDOWS__ #include "wx/msw/wrapwin.h" #else #include // for timeval @@ -79,7 +79,7 @@ // define some symbols which winsock.h defines but traditional BSD headers // don't -#ifndef __WXMSW__ +#ifndef __WINDOWS__ #define SOCKET int #endif @@ -367,7 +367,7 @@ private: wxDECLARE_NO_COPY_CLASS(wxSocketImpl); }; -#if defined(__WXMSW__) +#if defined(__WINDOWS__) #include "wx/msw/private/sockmsw.h" #else #include "wx/unix/private/sockunix.h" diff --git a/include/wx/private/wxprintf.h b/include/wx/private/wxprintf.h index ff74ee11ca..5c1e4ff348 100644 --- a/include/wx/private/wxprintf.h +++ b/include/wx/private/wxprintf.h @@ -289,7 +289,7 @@ bool wxPrintfConvSpec::Parse(const CharType *format) CHECK_PREC m_szFlags[flagofs++] = char(ch); break; -#ifdef __WXMSW__ +#ifdef __WINDOWS__ // under Windows we support the special '%I64' notation as longlong // integer conversion specifier for MSVC compatibility // (it behaves exactly as '%lli' or '%Li' or '%qi') @@ -308,7 +308,7 @@ bool wxPrintfConvSpec::Parse(const CharType *format) break; } // else: fall-through, 'I' is MSVC equivalent of C99 'z' -#endif // __WXMSW__ +#endif // __WINDOWS__ case wxT('z'): case wxT('Z'): diff --git a/include/wx/sound.h b/include/wx/sound.h index ef473443f7..d60d7f3d69 100644 --- a/include/wx/sound.h +++ b/include/wx/sound.h @@ -55,7 +55,7 @@ protected: // wxSound class implementation // ---------------------------------------------------------------------------- -#if defined(__WXMSW__) +#if defined(__WINDOWS__) #include "wx/msw/sound.h" #elif defined(__WXCOCOA__) #include "wx/cocoa/sound.h" diff --git a/include/wx/stackwalk.h b/include/wx/stackwalk.h index d787e8d18c..ed91376986 100644 --- a/include/wx/stackwalk.h +++ b/include/wx/stackwalk.h @@ -146,7 +146,7 @@ protected: virtual void OnStackFrame(const wxStackFrame& frame) = 0; }; -#ifdef __WXMSW__ +#ifdef __WINDOWS__ #include "wx/msw/stackwalk.h" #elif defined(__UNIX__) #include "wx/unix/stackwalk.h" diff --git a/include/wx/stdpaths.h b/include/wx/stdpaths.h index 7e146d6291..1bf5af0831 100644 --- a/include/wx/stdpaths.h +++ b/include/wx/stdpaths.h @@ -171,7 +171,7 @@ protected: }; #if wxUSE_STDPATHS - #if defined(__WXMSW__) + #if defined(__WINDOWS__) #include "wx/msw/stdpaths.h" #define wxHAS_NATIVE_STDPATHS // We want CoreFoundation paths on both CarbonLib and Darwin (for all ports) diff --git a/include/wx/string.h b/include/wx/string.h index 843002256a..8a38a4240b 100644 --- a/include/wx/string.h +++ b/include/wx/string.h @@ -69,7 +69,7 @@ // it would have to be re-tested and probably corrected // CS: under OSX release builds the string destructor/cache cleanup sometimes // crashes, disable until we find the true reason or a better workaround -#if wxUSE_UNICODE_UTF8 && !defined(__WXMSW__) && !defined(__WXOSX__) +#if wxUSE_UNICODE_UTF8 && !defined(__WINDOWS__) && !defined(__WXOSX__) #define wxUSE_STRING_POS_CACHE 1 #else #define wxUSE_STRING_POS_CACHE 0 diff --git a/include/wx/thread.h b/include/wx/thread.h index 9718c3998e..7ee8361ee9 100644 --- a/include/wx/thread.h +++ b/include/wx/thread.h @@ -219,7 +219,7 @@ private: // in order to avoid any overhead under platforms where critical sections are // just mutexes make all wxCriticalSection class functions inline -#if !defined(__WXMSW__) +#if !defined(__WINDOWS__) #define wxCRITSECT_IS_MUTEX 1 #define wxCRITSECT_INLINE WXEXPORT inline @@ -258,7 +258,7 @@ public: private: #if wxCRITSECT_IS_MUTEX wxMutex m_mutex; -#elif defined(__WXMSW__) +#elif defined(__WINDOWS__) // we can't allocate any memory in the ctor, so use placement new - // unfortunately, we have to hardcode the sizeof() here because we can't // include windows.h from this public header and we also have to use the @@ -844,7 +844,7 @@ public: #if wxUSE_THREADS -#if defined(__WXMSW__) || defined(__OS2__) || defined(__EMX__) || defined(__WXOSX__) +#if defined(__WINDOWS__) || defined(__OS2__) || defined(__EMX__) || defined(__WXOSX__) // unlock GUI if there are threads waiting for and lock it back when // there are no more of them - should be called periodically by the main // thread diff --git a/include/wx/thrimpl.cpp b/include/wx/thrimpl.cpp index 0874cd186c..585367d5e9 100644 --- a/include/wx/thrimpl.cpp +++ b/include/wx/thrimpl.cpp @@ -76,7 +76,7 @@ wxMutexError wxMutex::Unlock() // variables and their events/event semaphores have quite different semantics, // so we reimplement the conditions from scratch using the mutexes and // semaphores -#if defined(__WXMSW__) || defined(__OS2__) || defined(__EMX__) +#if defined(__WINDOWS__) || defined(__OS2__) || defined(__EMX__) class wxConditionInternal { @@ -223,7 +223,7 @@ wxCondError wxConditionInternal::Broadcast() return wxCOND_NO_ERROR; } -#endif // MSW or OS2 +#endif // __WINDOWS__ || __OS2__ || __EMX__ // ---------------------------------------------------------------------------- // wxCondition diff --git a/include/wx/tls.h b/include/wx/tls.h index 996fa251dd..4fbc287c5c 100644 --- a/include/wx/tls.h +++ b/include/wx/tls.h @@ -50,7 +50,7 @@ typedef void (*wxTlsDestructorFunction)(void*); } - #if defined(__WXMSW__) + #if defined(__WINDOWS__) #include "wx/msw/tls.h" #elif defined(__OS2__) #include "wx/os2/tls.h" diff --git a/include/wx/utils.h b/include/wx/utils.h index 45ae16eea5..8ef0cff3b0 100644 --- a/include/wx/utils.h +++ b/include/wx/utils.h @@ -410,12 +410,12 @@ WXDLLIMPEXP_BASE long wxExecute(const wxString& command, int flags = 0, const wxExecuteEnv *env = NULL); -#if defined(__WXMSW__) && wxUSE_IPC +#if defined(__WINDOWS__) && wxUSE_IPC // ask a DDE server to execute the DDE request with given parameters WXDLLIMPEXP_BASE bool wxExecuteDDE(const wxString& ddeServer, const wxString& ddeTopic, const wxString& ddeCommand); -#endif // __WXMSW__ && wxUSE_IPC +#endif // __WINDOWS__ && wxUSE_IPC enum wxSignal { @@ -815,8 +815,8 @@ WXDLLIMPEXP_CORE bool wxYieldIfNeeded(); // Windows resources access // ---------------------------------------------------------------------------- -// MSW only: get user-defined resource from the .res file. -#ifdef __WXMSW__ +// Windows only: get user-defined resource from the .res file. +#ifdef __WINDOWS__ // default resource type for wxLoadUserResource() extern WXDLLIMPEXP_DATA_BASE(const wxChar*) wxUserResourceStr; @@ -843,7 +843,7 @@ WXDLLIMPEXP_CORE bool wxYieldIfNeeded(); const wxString& resourceType = wxUserResourceStr, int* pLen = NULL, WXHINSTANCE module = 0); -#endif // MSW +#endif // __WINDOWS__ #endif // _WX_UTILSH__ diff --git a/src/common/appbase.cpp b/src/common/appbase.cpp index 544f727b9e..e10734beaa 100644 --- a/src/common/appbase.cpp +++ b/src/common/appbase.cpp @@ -25,7 +25,7 @@ #endif #ifndef WX_PRECOMP - #ifdef __WXMSW__ + #ifdef __WINDOWS__ #include "wx/msw/wrapwin.h" // includes windows.h for MessageBox() #endif #include "wx/list.h" @@ -52,7 +52,7 @@ #include #endif -#if !defined(__WXMSW__) || defined(__WXMICROWIN__) +#if !defined(__WINDOWS__) || defined(__WXMICROWIN__) #include // for SIGTRAP used by wxTrap() #endif //Win/Unix @@ -65,7 +65,7 @@ #if wxDEBUG_LEVEL #if wxUSE_STACKWALKER #include "wx/stackwalk.h" - #ifdef __WXMSW__ + #ifdef __WINDOWS__ #include "wx/msw/debughlp.h" #endif #endif // wxUSE_STACKWALKER @@ -896,12 +896,12 @@ wxString wxAppTraitsBase::GetAssertStackTrace() { #if wxDEBUG_LEVEL -#if !defined(__WXMSW__) +#if !defined(__WINDOWS__) // on Unix stack frame generation may take some time, depending on the // size of the executable mainly... warn the user that we are working wxFprintf(stderr, "Collecting stack trace information, please wait..."); fflush(stderr); -#endif // !__WXMSW__ +#endif // !__WINDOWS__ wxString stackTrace; @@ -1016,7 +1016,7 @@ void wxAbort() // break into the debugger void wxTrap() { -#if defined(__WXMSW__) && !defined(__WXMICROWIN__) +#if defined(__WINDOWS__) && !defined(__WXMICROWIN__) DebugBreak(); #elif defined(_MSL_USING_MW_C_HEADERS) && _MSL_USING_MW_C_HEADERS Debugger(); @@ -1179,8 +1179,8 @@ static void LINKAGEMODE SetTraceMasks() static bool DoShowAssertDialog(const wxString& msg) { - // under MSW we can show the dialog even in the console mode -#if defined(__WXMSW__) && !defined(__WXMICROWIN__) + // under Windows we can show the dialog even in the console mode +#if defined(__WINDOWS__) && !defined(__WXMICROWIN__) wxString msgDlg(msg); // this message is intentionally not translated -- it is for developers @@ -1203,9 +1203,9 @@ bool DoShowAssertDialog(const wxString& msg) //case IDNO: nothing to do } -#else // !__WXMSW__ +#else // !__WINDOWS__ wxUnusedVar(msg); -#endif // __WXMSW__/!__WXMSW__ +#endif // __WINDOWS__/!__WINDOWS__ // continue with the asserts by default return false; diff --git a/src/common/config.cpp b/src/common/config.cpp index e2438860f0..1ca75fa2cf 100644 --- a/src/common/config.cpp +++ b/src/common/config.cpp @@ -63,7 +63,7 @@ bool wxConfigBase::ms_bAutoCreate = true; wxConfigBase *wxAppTraitsBase::CreateConfig() { return new - #if defined(__WXMSW__) && wxUSE_CONFIG_NATIVE + #if defined(__WINDOWS__) && wxUSE_CONFIG_NATIVE wxRegConfig(wxTheApp->GetAppName(), wxTheApp->GetVendorName()); #else // either we're under Unix or wish to use files even under Windows wxFileConfig(wxTheApp->GetAppName()); @@ -385,7 +385,7 @@ enum Bracket Bracket_None, Bracket_Normal = ')', Bracket_Curly = '}', -#ifdef __WXMSW__ +#ifdef __WINDOWS__ Bracket_Windows = '%', // yeah, Windows people are a bit strange ;-) #endif Bracket_Max @@ -399,17 +399,17 @@ wxString wxExpandEnvVars(const wxString& str) size_t m; for ( size_t n = 0; n < str.length(); n++ ) { switch ( str[n].GetValue() ) { -#ifdef __WXMSW__ +#ifdef __WINDOWS__ case wxT('%'): -#endif //WINDOWS +#endif // __WINDOWS__ case wxT('$'): { Bracket bracket; - #ifdef __WXMSW__ + #ifdef __WINDOWS__ if ( str[n] == wxT('%') ) bracket = Bracket_Windows; else - #endif //WINDOWS + #endif // __WINDOWS__ if ( n == str.length() - 1 ) { bracket = Bracket_None; } @@ -453,7 +453,7 @@ wxString wxExpandEnvVars(const wxString& str) #endif { // variable doesn't exist => don't change anything - #ifdef __WXMSW__ + #ifdef __WINDOWS__ if ( bracket != Bracket_Windows ) #endif if ( bracket != Bracket_None ) @@ -470,10 +470,10 @@ wxString wxExpandEnvVars(const wxString& str) // // under Unix, OTOH, this warning could be useful for the user to // understand why isn't the variable expanded as intended - #ifndef __WXMSW__ + #ifndef __WINDOWS__ wxLogWarning(_("Environment variables expansion failed: missing '%c' at position %u in '%s'."), (char)bracket, (unsigned int) (m + 1), str.c_str()); - #endif // __WXMSW__ + #endif // __WINDOWS__ } else { // skip closing bracket unless the variables wasn't expanded diff --git a/src/common/datetime.cpp b/src/common/datetime.cpp index b70f3331fb..a2ca5d4ed8 100644 --- a/src/common/datetime.cpp +++ b/src/common/datetime.cpp @@ -63,7 +63,7 @@ #if !defined(wxUSE_DATETIME) || wxUSE_DATETIME #ifndef WX_PRECOMP - #ifdef __WXMSW__ + #ifdef __WINDOWS__ #include "wx/msw/wrapwin.h" #endif #include "wx/string.h" @@ -2198,7 +2198,7 @@ WXDLLIMPEXP_BASE void wxPrevWDay(wxDateTime::WeekDay& wd) : (wxDateTime::WeekDay)(wd - 1); } -#ifdef __WXMSW__ +#ifdef __WINDOWS__ wxDateTime& wxDateTime::SetFromMSWSysTime(const SYSTEMTIME& st) { @@ -2246,6 +2246,6 @@ void wxDateTime::GetAsMSWSysDate(SYSTEMTIME* st) const st->wMilliseconds = 0; } -#endif // __WXMSW__ +#endif // __WINDOWS__ #endif // wxUSE_DATETIME diff --git a/src/common/datetimefmt.cpp b/src/common/datetimefmt.cpp index c1dcd1fd2c..fed909fe8a 100644 --- a/src/common/datetimefmt.cpp +++ b/src/common/datetimefmt.cpp @@ -34,7 +34,7 @@ #if !defined(wxUSE_DATETIME) || wxUSE_DATETIME #ifndef WX_PRECOMP - #ifdef __WXMSW__ + #ifdef __WINDOWS__ #include "wx/msw/wrapwin.h" #endif #include "wx/string.h" @@ -326,7 +326,7 @@ wxString wxDateTime::Format(const wxString& formatp, const TimeZone& tz) const time_t time = GetTicks(); if ( (time != (time_t)-1) && !wxStrstr(format, wxT("%l")) -#ifdef __WXMSW__ +#ifdef __WINDOWS__ && !wxStrstr(format, wxT("%z")) #endif ) diff --git a/src/common/dummy.cpp b/src/common/dummy.cpp index db74ef7c68..98044d0f4d 100644 --- a/src/common/dummy.cpp +++ b/src/common/dummy.cpp @@ -23,7 +23,7 @@ #pragma hdrstop #endif -#ifdef __WXMSW__ +#ifdef __WINDOWS__ #include "wx/msw/msvcrt.h" #endif diff --git a/src/common/dynlib.cpp b/src/common/dynlib.cpp index d8ab264fb4..0ebec2bd9c 100644 --- a/src/common/dynlib.cpp +++ b/src/common/dynlib.cpp @@ -59,7 +59,7 @@ WX_DEFINE_USER_EXPORTED_OBJARRAY(wxDynamicLibraryDetailsArray) #endif // for MSW/Unix it is defined in platform-specific file -#if !(defined(__WXMSW__) || defined(__UNIX__)) || defined(__EMX__) +#if !(defined(__WINDOWS__) || defined(__UNIX__)) || defined(__EMX__) wxDllType wxDynamicLibrary::GetProgramHandle() { @@ -67,7 +67,7 @@ wxDllType wxDynamicLibrary::GetProgramHandle() return 0; } -#endif // __WXMSW__ || __UNIX__ +#endif // __WINDOWS__ || __UNIX__ bool wxDynamicLibrary::Load(const wxString& libnameOrig, int flags) @@ -112,7 +112,7 @@ bool wxDynamicLibrary::Load(const wxString& libnameOrig, int flags) // for MSW and Unix this is implemented in the platform-specific file // // TODO: move the rest to os2/dlpm.cpp and mac/dlmac.cpp! -#if (!defined(__WXMSW__) && !defined(__UNIX__)) || defined(__EMX__) +#if (!defined(__WINDOWS__) && !defined(__UNIX__)) || defined(__EMX__) /* static */ void wxDynamicLibrary::Unload(wxDllType handle) @@ -124,7 +124,7 @@ void wxDynamicLibrary::Unload(wxDllType handle) #endif } -#endif // !(__WXMSW__ || __UNIX__) +#endif // !(__WINDOWS__ || __UNIX__) void *wxDynamicLibrary::DoGetSymbol(const wxString &name, bool *success) const { diff --git a/src/common/encconv.cpp b/src/common/encconv.cpp index fdfa64eb6a..e666b9f245 100644 --- a/src/common/encconv.cpp +++ b/src/common/encconv.cpp @@ -444,7 +444,7 @@ wxFontEncodingArray wxEncodingConverter::GetPlatformEquivalents(wxFontEncoding e { if (platform == wxPLATFORM_CURRENT) { -#if defined(__WXMSW__) +#if defined(__WINDOWS__) platform = wxPLATFORM_WINDOWS; #elif defined(__WXGTK__) || defined(__WXMOTIF__) platform = wxPLATFORM_UNIX; diff --git a/src/common/evtloopcmn.cpp b/src/common/evtloopcmn.cpp index aa1aca9cbc..d824c31822 100644 --- a/src/common/evtloopcmn.cpp +++ b/src/common/evtloopcmn.cpp @@ -82,7 +82,7 @@ bool wxEventLoopBase::Yield(bool onlyIfNeeded) } // wxEventLoopManual is unused in the other ports -#if defined(__WXMSW__) || defined(__WXDFB__) || ( ( defined(__UNIX__) && !defined(__WXOSX__) ) && wxUSE_BASE) +#if defined(__WINDOWS__) || defined(__WXDFB__) || ( ( defined(__UNIX__) && !defined(__WXOSX__) ) && wxUSE_BASE) // ============================================================================ // wxEventLoopManual implementation @@ -213,5 +213,5 @@ void wxEventLoopManual::Exit(int rc) WakeUp(); } -#endif // __WXMSW__ || __WXMAC__ || __WXDFB__ +#endif // __WINDOWS__ || __WXMAC__ || __WXDFB__ diff --git a/src/common/file.cpp b/src/common/file.cpp index 0364794e8b..2701cfcb41 100644 --- a/src/common/file.cpp +++ b/src/common/file.cpp @@ -24,7 +24,7 @@ #if wxUSE_FILE // standard -#if defined(__WXMSW__) && !defined(__GNUWIN32__) && !defined(__WXMICROWIN__) && !defined(__WXWINCE__) +#if defined(__WINDOWS__) && !defined(__GNUWIN32__) && !defined(__WXMICROWIN__) && !defined(__WXWINCE__) #define WIN32_LEAN_AND_MEAN #define NOSERVICE @@ -47,7 +47,7 @@ #define NOCRYPT #define NOMCX -#elif defined(__WXMSW__) && defined(__WXWINCE__) +#elif defined(__WINDOWS__) && defined(__WXWINCE__) #include "wx/msw/missing.h" #elif (defined(__OS2__)) #include @@ -119,7 +119,7 @@ #define O_BINARY (0) #endif //__UNIX__ -#ifdef __WXMSW__ +#ifdef __WINDOWS__ #include "wx/msw/mslu.h" #endif diff --git a/src/common/fileconf.cpp b/src/common/fileconf.cpp index ee79bdba34..75fcd7c88a 100644 --- a/src/common/fileconf.cpp +++ b/src/common/fileconf.cpp @@ -46,7 +46,7 @@ #include "wx/stdpaths.h" -#if defined(__WXMSW__) +#if defined(__WINDOWS__) #include "wx/msw/private.h" #endif //windows.h #if defined(__WXPM__) diff --git a/src/common/filefn.cpp b/src/common/filefn.cpp index 2da2831468..100ca385dc 100644 --- a/src/common/filefn.cpp +++ b/src/common/filefn.cpp @@ -367,7 +367,7 @@ template static CharType *wxDoRealPath (CharType *path) { static const CharType SEP = wxFILE_SEP_PATH; -#ifdef __WXMSW__ +#ifdef __WINDOWS__ wxUnix2DosFilename(path); #endif if (path[0] && path[1]) { @@ -398,7 +398,7 @@ static CharType *wxDoRealPath (CharType *path) path[0] = SEP; path[1] = wxT('\0'); } -#if defined(__WXMSW__) || defined(__OS2__) +#if defined(__WINDOWS__) || defined(__OS2__) /* Check that path[2] is NULL! */ else if (path[1] == wxT(':') && !path[2]) { @@ -447,7 +447,7 @@ wxChar *wxCopyAbsolutePath(const wxString& filename) { wxString buf = ::wxGetCwd(); wxChar ch = buf.Last(); -#ifdef __WXMSW__ +#ifdef __WINDOWS__ if (ch != wxT('\\') && ch != wxT('/')) buf << wxT("\\"); #else @@ -501,7 +501,7 @@ static CharType *wxDoExpandPath(CharType *buf, const wxString& name) trimchars[3] = 0; static const CharType SEP = wxFILE_SEP_PATH; -#ifdef __WXMSW__ +#ifdef __WINDOWS__ //wxUnix2DosFilename(path); #endif @@ -521,7 +521,7 @@ static CharType *wxDoExpandPath(CharType *buf, const wxString& name) s = nm; d = lnm; -#ifdef __WXMSW__ +#ifdef __WINDOWS__ q = FALSE; #else q = nm[0] == wxT('\\') && nm[1] == wxT('~'); @@ -546,7 +546,7 @@ static CharType *wxDoExpandPath(CharType *buf, const wxString& name) else #else while ((*d++ = *s) != 0) { -# ifndef __WXMSW__ +# ifndef __WINDOWS__ if (*s == wxT('\\')) { if ((*(d - 1) = *++s)!=0) { s++; @@ -558,7 +558,7 @@ static CharType *wxDoExpandPath(CharType *buf, const wxString& name) #endif // No env variables on WinCE #ifndef __WXWINCE__ -#ifdef __WXMSW__ +#ifdef __WINDOWS__ if (*s++ == wxT('$') && (*s == wxT('{') || *s == wxT(')'))) #else if (*s++ == wxT('$')) @@ -677,7 +677,7 @@ wxContractPath (const wxString& filename, return NULL; wxStrcpy (dest, filename); -#ifdef __WXMSW__ +#ifdef __WINDOWS__ wxUnix2DosFilename(dest); #endif @@ -767,7 +767,7 @@ wxPathOnly (wxChar *path) i --; } -#if defined(__WXMSW__) || defined(__OS2__) +#if defined(__WINDOWS__) || defined(__OS2__) // Try Drive specifier if (wxIsalpha (buf[0]) && buf[1] == wxT(':')) { @@ -816,7 +816,7 @@ wxString wxPathOnly (const wxString& path) i --; } -#if defined(__WXMSW__) || defined(__OS2__) +#if defined(__WINDOWS__) || defined(__OS2__) // Try Drive specifier if (wxIsalpha (buf[0]) && buf[1] == wxT(':')) { @@ -923,7 +923,7 @@ static void wxDoDos2UnixFilename(T *s) { if (*s == wxT('\\')) *s = wxT('/'); -#ifdef __WXMSW__ +#ifdef __WINDOWS__ else *s = wxTolower(*s); // Case INDEPENDENT #endif @@ -936,14 +936,14 @@ void wxDos2UnixFilename(wchar_t *s) { wxDoDos2UnixFilename(s); } template static void -#if defined(__WXMSW__) || defined(__OS2__) +#if defined(__WINDOWS__) || defined(__OS2__) wxDoUnix2DosFilename(T *s) #else wxDoUnix2DosFilename(T *WXUNUSED(s) ) #endif { // Yes, I really mean this to happen under DOS only! JACS -#if defined(__WXMSW__) || defined(__OS2__) +#if defined(__WINDOWS__) || defined(__OS2__) if (s) while (*s) { @@ -1150,7 +1150,7 @@ wxCopyFile (const wxString& file1, const wxString& file2, bool overwrite) wxUnusedVar(overwrite); return false; -#endif // __WXMSW__ && __WIN32__ +#endif // __WINDOWS__ && __WIN32__ return true; } @@ -1213,7 +1213,7 @@ bool wxMkdir(const wxString& dir, int perm) // assume mkdir() has 2 args on non Windows-OS/2 platforms and on Windows too // for the GNU compiler -#elif (!(defined(__WXMSW__) || defined(__OS2__) || defined(__DOS__))) || \ +#elif (!(defined(__WINDOWS__) || defined(__OS2__) || defined(__DOS__))) || \ (defined(__GNUWIN32__) && !defined(__MINGW32__)) || \ defined(__WINE__) || defined(__WXMICROWIN__) const wxChar *dirname = dir.c_str(); @@ -1863,7 +1863,7 @@ bool wxIsExecutable(const wxString &path) // wxFileKind wxGetFileKind(int fd) { -#if defined __WXMSW__ && !defined __WXWINCE__ && defined wxGetOSFHandle +#if defined __WINDOWS__ && !defined __WXWINCE__ && defined wxGetOSFHandle switch (::GetFileType(wxGetOSFHandle(fd)) & ~FILE_TYPE_REMOTE) { case FILE_TYPE_CHAR: diff --git a/src/common/filename.cpp b/src/common/filename.cpp index 79e2cae278..5f693d07d2 100644 --- a/src/common/filename.cpp +++ b/src/common/filename.cpp @@ -77,7 +77,7 @@ #endif #ifndef WX_PRECOMP - #ifdef __WXMSW__ + #ifdef __WINDOWS__ #include "wx/msw/wrapwin.h" // For GetShort/LongPathName #endif #include "wx/dynarray.h" @@ -98,7 +98,7 @@ #include "wx/msw/gccpriv.h" #endif -#ifdef __WXMSW__ +#ifdef __WINDOWS__ #include "wx/msw/private.h" #endif @@ -1318,7 +1318,7 @@ bool wxFileName::Rmdir(int flags) const bool wxFileName::Rmdir(const wxString& dir, int flags) { -#ifdef __WXMSW__ +#ifdef __WINDOWS__ if ( flags & wxPATH_RMDIR_RECURSIVE ) { // SHFileOperation needs double null termination string @@ -1354,9 +1354,9 @@ bool wxFileName::Rmdir(const wxString& dir, int flags) return true; } else if ( flags & wxPATH_RMDIR_FULL ) -#else // !__WXMSW__ +#else // !__WINDOWS__ if ( flags != 0 ) // wxPATH_RMDIR_FULL or wxPATH_RMDIR_RECURSIVE -#endif // !__WXMSW__ +#endif // !__WINDOWS__ { wxString path(dir); if ( path.Last() != wxFILE_SEP_PATH ) @@ -1377,7 +1377,7 @@ bool wxFileName::Rmdir(const wxString& dir, int flags) cont = d.GetNext(&filename); } -#ifndef __WXMSW__ +#ifndef __WINDOWS__ if ( flags & wxPATH_RMDIR_RECURSIVE ) { // delete all files too @@ -1388,7 +1388,7 @@ bool wxFileName::Rmdir(const wxString& dir, int flags) cont = d.GetNext(&filename); } } -#endif // !__WXMSW__ +#endif // !__WINDOWS__ } return ::wxRmdir(dir); @@ -2122,7 +2122,7 @@ wxString wxFileName::GetShortPath() const { wxString path(GetFullPath()); -#if defined(__WXMSW__) && defined(__WIN32__) && !defined(__WXMICROWIN__) && !defined(__WXWINCE__) +#if defined(__WINDOWS__) && defined(__WIN32__) && !defined(__WXMICROWIN__) && !defined(__WXWINCE__) DWORD sz = ::GetShortPathName(path.t_str(), NULL, 0); if ( sz != 0 ) { @@ -2272,7 +2272,7 @@ wxPathFormat wxFileName::GetFormat( wxPathFormat format ) { if (format == wxPATH_NATIVE) { -#if defined(__WXMSW__) || defined(__OS2__) || defined(__DOS__) +#if defined(__WINDOWS__) || defined(__OS2__) || defined(__DOS__) format = wxPATH_DOS; #elif defined(__VMS) format = wxPATH_VMS; diff --git a/src/common/filesys.cpp b/src/common/filesys.cpp index 9f5a7c9a24..4f7becfebb 100644 --- a/src/common/filesys.cpp +++ b/src/common/filesys.cpp @@ -635,7 +635,7 @@ wxFileName wxFileSystem::URLToFileName(const wxString& url) path = wxURI::Unescape(path); -#ifdef __WXMSW__ +#ifdef __WINDOWS__ // file urls either start with a forward slash (local harddisk), // otherwise they have a servername/sharename notation, // which only exists on msw and corresponds to a unc diff --git a/src/common/fmapbase.cpp b/src/common/fmapbase.cpp index 5d52d48d75..2fe0cccbad 100644 --- a/src/common/fmapbase.cpp +++ b/src/common/fmapbase.cpp @@ -34,7 +34,7 @@ #include "wx/wxcrtvararg.h" #endif //WX_PRECOMP -#if defined(__WXMSW__) +#if defined(__WINDOWS__) #include "wx/msw/private.h" // includes windows.h for LOGFONT #include "wx/msw/winundef.h" #endif diff --git a/src/common/init.cpp b/src/common/init.cpp index 561b726ccd..8b11d75ce1 100644 --- a/src/common/init.cpp +++ b/src/common/init.cpp @@ -37,7 +37,7 @@ #include "wx/scopedptr.h" #include "wx/except.h" -#if defined(__WXMSW__) +#if defined(__WINDOWS__) #include "wx/msw/private.h" #include "wx/msw/msvcrt.h" @@ -53,7 +53,7 @@ } } gs_enableLeakChecks; #endif // wxCrtSetDbgFlag -#endif // __WXMSW__ +#endif // __WINDOWS__ // ---------------------------------------------------------------------------- // private classes @@ -238,7 +238,7 @@ static bool DoCommonPreInit() wxLog::GetActiveTarget(); #endif // wxUSE_LOG -#ifdef __WXMSW__ +#ifdef __WINDOWS__ // GUI applications obtain HINSTANCE in their WinMain() but we also need to // initialize the global wxhInstance variable for the console programs as // they may need it too, so set it here if it wasn't done yet @@ -246,7 +246,7 @@ static bool DoCommonPreInit() { wxSetInstance(::GetModuleHandle(NULL)); } -#endif // __WXMSW__ +#endif // __WINDOWS__ return true; } @@ -432,9 +432,9 @@ void wxEntryCleanup() // ---------------------------------------------------------------------------- // for MSW the real wxEntry is defined in msw/main.cpp -#ifndef __WXMSW__ +#ifndef __WINDOWS__ #define wxEntryReal wxEntry -#endif // !__WXMSW__ +#endif // !__WINDOWS__ int wxEntryReal(int& argc, wxChar **argv) { diff --git a/src/common/intl.cpp b/src/common/intl.cpp index 40d6fa1db5..c9203192ee 100644 --- a/src/common/intl.cpp +++ b/src/common/intl.cpp @@ -121,7 +121,7 @@ inline wxString ExtractNotLang(const wxString& langFull) // wxLanguageInfo // ---------------------------------------------------------------------------- -#ifdef __WXMSW__ +#ifdef __WINDOWS__ // helper used by wxLanguageInfo::GetLocaleName() and elsewhere to determine // whether the locale is Unicode-only (it is if this function returns empty @@ -177,7 +177,7 @@ wxString wxLanguageInfo::GetLocaleName() const return locale; } -#endif // __WXMSW__ +#endif // __WINDOWS__ // ---------------------------------------------------------------------------- // wxLocale @@ -1126,7 +1126,7 @@ wxString wxLocale::GetHeaderValue(const wxString& header, // accessors for locale-dependent data // ---------------------------------------------------------------------------- -#if defined(__WXMSW__) || defined(__WXOSX__) +#if defined(__WINDOWS__) || defined(__WXOSX__) namespace { @@ -1148,7 +1148,7 @@ static wxString TranslateFromUnicodeFormat(const wxString& fmt) const char* formatchars = "dghHmMsSy" -#ifdef __WXMSW__ +#ifdef __WINDOWS__ "t" #else "EawD" @@ -1188,7 +1188,7 @@ static wxString TranslateFromUnicodeFormat(const wxString& fmt) // between 1 and 2 digits for days fmtWX += "%d"; break; -#ifdef __WXMSW__ +#ifdef __WINDOWS__ case 3: // ddd fmtWX += "%a"; break; @@ -1201,7 +1201,7 @@ static wxString TranslateFromUnicodeFormat(const wxString& fmt) wxFAIL_MSG( "too many 'd's" ); } break; -#ifndef __WXMSW__ +#ifndef __WINDOWS__ case 'D': switch ( lastCount ) { @@ -1344,12 +1344,12 @@ static wxString TranslateFromUnicodeFormat(const wxString& fmt) wxASSERT_MSG( lastCount <= 2, "too many 'g's" ); break; -#ifndef __WXMSW__ +#ifndef __WINDOWS__ case 'a': fmtWX += "%p"; break; #endif -#ifdef __WXMSW__ +#ifdef __WINDOWS__ case 't': switch ( lastCount ) { @@ -1389,9 +1389,9 @@ static wxString TranslateFromUnicodeFormat(const wxString& fmt) } // anonymous namespace -#endif // __WXMSW__ || __WXOSX__ +#endif // __WINDOWS__ || __WXOSX__ -#if defined(__WXMSW__) +#if defined(__WINDOWS__) namespace { @@ -1582,7 +1582,7 @@ wxString wxLocale::GetInfo(wxLocaleInfo index, wxLocaleCategory WXUNUSED(cat)) return str.AsString(); } -#else // !__WXMSW__ && !__WXOSX__, assume generic POSIX +#else // !__WINDOWS__ && !__WXOSX__, assume generic POSIX namespace { diff --git a/src/common/log.cpp b/src/common/log.cpp index 6b2f3a0456..5135eadaa3 100644 --- a/src/common/log.cpp +++ b/src/common/log.cpp @@ -215,9 +215,9 @@ wxLogFormatter::Format(wxLogLevel level, // don't time stamp debug messages under MSW as debug viewers usually // already have an option to do it -#ifdef __WXMSW__ +#ifdef __WINDOWS__ if ( level != wxLOG_Debug && level != wxLOG_Trace ) -#endif // __WXMSW__ +#endif // __WINDOWS__ prefix = FormatTime(info.timestamp); switch ( level ) @@ -232,7 +232,7 @@ wxLogFormatter::Format(wxLogLevel level, // don't prepend "debug/trace" prefix under MSW as it goes to the debug // window anyhow and so can't be confused with something else -#ifndef __WXMSW__ +#ifndef __WINDOWS__ case wxLOG_Debug: // this prefix (as well as the one below) is intentionally not // translated as nobody translates debug messages anyhow @@ -242,7 +242,7 @@ wxLogFormatter::Format(wxLogLevel level, case wxLOG_Trace: prefix += "Trace: "; break; -#endif // !__WXMSW__ +#endif // !__WINDOWS__ } return prefix + msg; @@ -1048,7 +1048,7 @@ static void wxLogWrap(FILE *f, const char *pszPrefix, const char *psz) // get error code from syste unsigned long wxSysErrorCode() { -#if defined(__WXMSW__) && !defined(__WXMICROWIN__) +#if defined(__WINDOWS__) && !defined(__WXMICROWIN__) return ::GetLastError(); #else //Unix return errno; @@ -1061,7 +1061,7 @@ const wxChar *wxSysErrorMsg(unsigned long nErrCode) if ( nErrCode == 0 ) nErrCode = wxSysErrorCode(); -#if defined(__WXMSW__) && !defined(__WXMICROWIN__) +#if defined(__WINDOWS__) && !defined(__WXMICROWIN__) static wxChar s_szBuf[1024]; // get error message from system @@ -1109,7 +1109,7 @@ const wxChar *wxSysErrorMsg(unsigned long nErrCode) } return s_szBuf; -#else // !__WXMSW__ +#else // !__WINDOWS__ #if wxUSE_UNICODE static wchar_t s_wzBuf[1024]; wxConvCurrent->MB2WC(s_wzBuf, strerror((int)nErrCode), @@ -1118,7 +1118,7 @@ const wxChar *wxSysErrorMsg(unsigned long nErrCode) #else return strerror((int)nErrCode); #endif -#endif // __WXMSW__/!__WXMSW__ +#endif // __WINDOWS__/!__WINDOWS__ } #endif // wxUSE_LOG diff --git a/src/common/memory.cpp b/src/common/memory.cpp index 4253bae38e..dd4da0d58f 100644 --- a/src/common/memory.cpp +++ b/src/common/memory.cpp @@ -21,7 +21,7 @@ #include "wx/memory.h" #ifndef WX_PRECOMP - #ifdef __WXMSW__ + #ifdef __WINDOWS__ #include "wx/msw/wrapwin.h" #endif #include "wx/utils.h" @@ -888,7 +888,7 @@ static MemoryCriticalSection memLocker; #endif // USE_THREADSAFE_MEMORY_ALLOCATION -#if !(defined(__WXMSW__) && (defined(WXUSINGDLL) || defined(WXMAKINGDLL_BASE))) +#if !(defined(__WINDOWS__) && (defined(WXUSINGDLL) || defined(WXMAKINGDLL_BASE))) #if wxUSE_GLOBAL_MEMORY_OPERATORS void * operator new (size_t size, wxChar * fileName, int lineNum) { @@ -922,7 +922,7 @@ void operator delete[] (void * buf) } #endif // wxUSE_ARRAY_MEMORY_OPERATORS #endif // wxUSE_GLOBAL_MEMORY_OPERATORS -#endif // !(defined(__WXMSW__) && (defined(WXUSINGDLL) || defined(WXMAKINGDLL_BASE))) +#endif // !(defined(__WINDOWS__) && (defined(WXUSINGDLL) || defined(WXMAKINGDLL_BASE))) // TODO: store whether this is a vector or not. void * wxDebugAlloc(size_t size, wxChar * fileName, int lineNum, bool isObject, bool WXUNUSED(isVect) ) @@ -1045,7 +1045,7 @@ void wxTrace(const wxChar * ...) va_start(ap, fmt); -#ifdef __WXMSW__ +#ifdef __WINDOWS__ wvsprintf(buffer,fmt,ap) ; #else vsprintf(buffer,fmt,ap) ; @@ -1059,7 +1059,7 @@ void wxTrace(const wxChar * ...) wxDebugContext::GetStream().flush(); } else -#ifdef __WXMSW__ +#ifdef __WINDOWS__ #ifdef __WIN32__ OutputDebugString((LPCTSTR)buffer) ; #else @@ -1085,7 +1085,7 @@ void wxTraceLevel(int, const wxChar * ...) va_start(ap, fmt); -#ifdef __WXMSW__ +#ifdef __WINDOWS__ wxWvsprintf(buffer,fmt,ap) ; #else vsprintf(buffer,fmt,ap) ; @@ -1099,7 +1099,7 @@ void wxTraceLevel(int, const wxChar * ...) wxDebugContext::GetStream().flush(); } else -#ifdef __WXMSW__ +#ifdef __WINDOWS__ #ifdef __WIN32__ OutputDebugString((LPCTSTR)buffer) ; #else diff --git a/src/common/mimecmn.cpp b/src/common/mimecmn.cpp index f159809a84..63ef69d6e6 100644 --- a/src/common/mimecmn.cpp +++ b/src/common/mimecmn.cpp @@ -46,7 +46,7 @@ #include // implementation classes: -#if defined(__WXMSW__) +#if defined(__WINDOWS__) #include "wx/msw/mimetype.h" #elif ( defined(__WXMAC__) ) #include "wx/osx/mimetype.h" @@ -346,9 +346,9 @@ bool wxFileType::GetIcon(wxIconLocation *iconLoc) const if ( iconLoc ) { iconLoc->SetFileName(m_info->GetIconFile()); -#ifdef __WXMSW__ +#ifdef __WINDOWS__ iconLoc->SetIndex(m_info->GetIconIndex()); -#endif // __WXMSW__ +#endif // __WINDOWS__ } return true; @@ -444,9 +444,9 @@ size_t wxFileType::GetAllCommands(wxArrayString *verbs, if ( commands ) commands->Clear(); -#if defined (__WXMSW__) || defined(__UNIX__) +#if defined (__WINDOWS__) || defined(__UNIX__) return m_impl->GetAllCommands(verbs, commands, params); -#else // !__WXMSW__ || Unix +#else // !__WINDOWS__ || __UNIX__ // we don't know how to retrieve all commands, so just try the 2 we know // about size_t count = 0; @@ -471,12 +471,12 @@ size_t wxFileType::GetAllCommands(wxArrayString *verbs, } return count; -#endif // __WXMSW__/| __UNIX__ +#endif // __WINDOWS__/| __UNIX__ } bool wxFileType::Unassociate() { -#if defined(__WXMSW__) +#if defined(__WINDOWS__) return m_impl->Unassociate(); #elif defined(__UNIX__) return m_impl->Unassociate(this); @@ -490,7 +490,7 @@ bool wxFileType::SetCommand(const wxString& cmd, const wxString& verb, bool overwriteprompt) { -#if defined (__WXMSW__) || defined(__UNIX__) +#if defined (__WINDOWS__) || defined(__UNIX__) return m_impl->SetCommand(cmd, verb, overwriteprompt); #else wxUnusedVar(cmd); @@ -504,7 +504,7 @@ bool wxFileType::SetCommand(const wxString& cmd, bool wxFileType::SetDefaultIcon(const wxString& cmd, int index) { wxString sTmp = cmd; -#ifdef __WXMSW__ +#ifdef __WINDOWS__ // VZ: should we do this? // chris elliott : only makes sense in MS windows if ( sTmp.empty() ) @@ -512,7 +512,7 @@ bool wxFileType::SetDefaultIcon(const wxString& cmd, int index) #endif wxCHECK_MSG( !sTmp.empty(), false, wxT("need the icon file") ); -#if defined (__WXMSW__) || defined(__UNIX__) +#if defined (__WINDOWS__) || defined(__UNIX__) return m_impl->SetDefaultIcon (cmd, index); #else wxUnusedVar(index); @@ -610,7 +610,7 @@ wxMimeTypesManager::Associate(const wxFileTypeInfo& ftInfo) { EnsureImpl(); -#if defined(__WXMSW__) || defined(__UNIX__) +#if defined(__WINDOWS__) || defined(__UNIX__) return m_impl->Associate(ftInfo); #else // other platforms wxUnusedVar(ftInfo); diff --git a/src/common/powercmn.cpp b/src/common/powercmn.cpp index 043afbeaee..bb5acce9e4 100644 --- a/src/common/powercmn.cpp +++ b/src/common/powercmn.cpp @@ -43,7 +43,7 @@ #endif // provide stubs for the systems not implementing these functions -#if !defined(__WXMSW__) +#if !defined(__WINDOWS__) wxPowerType wxGetPowerType() { diff --git a/src/common/sckaddr.cpp b/src/common/sckaddr.cpp index 0e1a95c96e..0d8c33609b 100644 --- a/src/common/sckaddr.cpp +++ b/src/common/sckaddr.cpp @@ -79,7 +79,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxUNIXaddress, wxSockAddress) // TODO: use POSIX getaddrinfo() (also available in Winsock 2) for simplicity // and to use the same code for IPv4 and IPv6 support -#ifdef __WXMSW__ +#ifdef __WINDOWS__ #define HAVE_INET_ADDR #ifndef HAVE_GETHOSTBYNAME @@ -109,7 +109,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxUNIXaddress, wxSockAddress) #pragma warning(default:4706) #endif #endif -#endif // __WXMSW__ +#endif // __WINDOWS__ // we assume that we have gethostbyaddr_r() if and only if we have // gethostbyname_r() and that it uses the similar conventions to it (see diff --git a/src/common/stopwatch.cpp b/src/common/stopwatch.cpp index f36696dff0..d71d1e9127 100644 --- a/src/common/stopwatch.cpp +++ b/src/common/stopwatch.cpp @@ -33,7 +33,7 @@ #if wxUSE_STOPWATCH #ifndef WX_PRECOMP - #ifdef __WXMSW__ + #ifdef __WINDOWS__ #include "wx/msw/wrapwin.h" #endif #include "wx/log.h" @@ -51,7 +51,7 @@ namespace { -#ifdef __WXMSW__ +#ifdef __WINDOWS__ struct PerfCounter { @@ -70,7 +70,7 @@ struct PerfCounter bool init; } gs_perfCounter; -#endif // __WXMSW__ +#endif // __WINDOWS__ const int MILLISECONDS_PER_SECOND = 1000; const int MICROSECONDS_PER_MILLISECOND = 1000; @@ -80,7 +80,7 @@ const int MICROSECONDS_PER_SECOND = 1000*1000; void wxStopWatch::DoStart() { -#ifdef __WXMSW__ +#ifdef __WINDOWS__ if ( !gs_perfCounter.init ) { wxCRIT_SECT_LOCKER(lock, gs_perfCounter.cs); @@ -99,19 +99,19 @@ void wxStopWatch::DoStart() gs_perfCounter.init = true; } -#endif // __WXMSW__ +#endif // __WINDOWS__ m_t0 = GetCurrentClockValue(); } wxLongLong wxStopWatch::GetClockFreq() const { -#ifdef __WXMSW__ +#ifdef __WINDOWS__ // Under MSW we use the high resolution performance counter timer which has // its own frequency (usually related to the CPU clock speed). if ( gs_perfCounter.CanBeUsed() ) return gs_perfCounter.freq.QuadPart; -#endif // __WXMSW__ +#endif // __WINDOWS__ #ifdef HAVE_GETTIMEOFDAY // With gettimeofday() we can have nominally microsecond precision and @@ -137,14 +137,14 @@ void wxStopWatch::Start(long t0) wxLongLong wxStopWatch::GetCurrentClockValue() const { -#ifdef __WXMSW__ +#ifdef __WINDOWS__ if ( gs_perfCounter.CanBeUsed() ) { LARGE_INTEGER counter; ::QueryPerformanceCounter(&counter); return counter.QuadPart; } -#endif // __WXMSW__ +#endif // __WINDOWS__ #ifdef HAVE_GETTIMEOFDAY return wxGetUTCTimeUSec(); diff --git a/src/common/string.cpp b/src/common/string.cpp index 2978dcdca8..d92df7a08c 100644 --- a/src/common/string.cpp +++ b/src/common/string.cpp @@ -41,9 +41,9 @@ #include "wx/vector.h" #include "wx/xlocale.h" -#ifdef __WXMSW__ +#ifdef __WINDOWS__ #include "wx/msw/wrapwin.h" -#endif // __WXMSW__ +#endif // __WINDOWS__ #if wxUSE_STD_IOSTREAM #include diff --git a/src/common/time.cpp b/src/common/time.cpp index ff163db0cc..ebc597d969 100644 --- a/src/common/time.cpp +++ b/src/common/time.cpp @@ -26,7 +26,7 @@ #include "wx/time.h" #ifndef WX_PRECOMP - #ifdef __WXMSW__ + #ifdef __WINDOWS__ #include "wx/msw/wrapwin.h" #endif #include "wx/intl.h" @@ -48,7 +48,7 @@ # endif #endif -#if defined(__MWERKS__) && defined(__WXMSW__) +#if defined(__MWERKS__) && defined(__WINDOWS__) # undef HAVE_FTIME # undef HAVE_GETTIMEOFDAY #endif @@ -274,7 +274,7 @@ long wxGetUTCTime() wxLongLong wxGetUTCTimeUSec() { -#if defined(__WXMSW__) +#if defined(__WINDOWS__) FILETIME ft; ::GetSystemTimeAsFileTime(&ft); @@ -309,7 +309,7 @@ wxLongLong wxGetUTCTimeMillis() // If possible, use a function which avoids conversions from // broken-up time structures to milliseconds -#if defined(__WXMSW__) +#if defined(__WINDOWS__) FILETIME ft; ::GetSystemTimeAsFileTime(&ft); diff --git a/src/common/translation.cpp b/src/common/translation.cpp index bf586b24bb..417588526d 100644 --- a/src/common/translation.cpp +++ b/src/common/translation.cpp @@ -50,7 +50,7 @@ #include "wx/stdpaths.h" #include "wx/hashset.h" -#ifdef __WXMSW__ +#ifdef __WINDOWS__ #include "wx/msw/wrapwin.h" #endif diff --git a/src/common/txtstrm.cpp b/src/common/txtstrm.cpp index 9408345960..7ae75f5b76 100644 --- a/src/common/txtstrm.cpp +++ b/src/common/txtstrm.cpp @@ -336,7 +336,7 @@ wxTextOutputStream::wxTextOutputStream(wxOutputStream& s, wxEOL mode) m_mode = mode; if (m_mode == wxEOL_NATIVE) { -#if defined(__WXMSW__) || defined(__WXPM__) +#if defined(__WINDOWS__) || defined(__WXPM__) m_mode = wxEOL_DOS; #else m_mode = wxEOL_UNIX; @@ -356,7 +356,7 @@ void wxTextOutputStream::SetMode(wxEOL mode) m_mode = mode; if (m_mode == wxEOL_NATIVE) { -#if defined(__WXMSW__) || defined(__WXPM__) +#if defined(__WINDOWS__) || defined(__WXPM__) m_mode = wxEOL_DOS; #else m_mode = wxEOL_UNIX; diff --git a/src/common/utilscmn.cpp b/src/common/utilscmn.cpp index 749d1ff6cb..fe29bc8a5a 100644 --- a/src/common/utilscmn.cpp +++ b/src/common/utilscmn.cpp @@ -91,7 +91,7 @@ #include #endif -#if defined(__WXMSW__) +#if defined(__WINDOWS__) #include "wx/msw/private.h" #include "wx/filesys.h" #endif @@ -350,7 +350,7 @@ void wxPlatform::ClearPlatforms() bool wxPlatform::Is(int platform) { -#ifdef __WXMSW__ +#ifdef __WINDOWS__ if (platform == wxOS_WINDOWS) return true; #endif @@ -583,9 +583,9 @@ bool wxGetEnvMap(wxEnvVariableHashMap *map) // standard headers anyhow so we can just rely on already having the // correct declaration. And if this turns out to be wrong, we can always // add a configure test checking whether it is declared later. -#ifndef __WXMSW__ +#ifndef __WINDOWS__ extern char **environ; -#endif // !__WXMSW__ +#endif // !__WINDOWS__ char **env = environ; #endif @@ -998,7 +998,7 @@ bool wxSetDetectableAutoRepeat( bool WXUNUSED(flag) ) // Launch default browser // ---------------------------------------------------------------------------- -#if defined(__WXMSW__) +#if defined(__WINDOWS__) // implemented in a port-specific utils source file: bool wxDoLaunchDefaultBrowser(const wxString& url, const wxString& scheme, int flags); @@ -1064,7 +1064,7 @@ static bool DoLaunchDefaultBrowserHelper(const wxString& urlOrig, int flags) // (e.g. "C:\\test.txt" when parsed by wxURI reports a scheme == "C") bool hasValidScheme = uri.HasScheme() && uri.GetScheme().length() > 1; -#if defined(__WXMSW__) +#if defined(__WINDOWS__) // NOTE: when testing wxMSW's wxLaunchDefaultBrowser all possible forms // of the URL/flags should be tested; e.g.: diff --git a/src/common/zstream.cpp b/src/common/zstream.cpp index 739a58e836..031dbb29e8 100644 --- a/src/common/zstream.cpp +++ b/src/common/zstream.cpp @@ -32,7 +32,7 @@ // apparently not the case for all MSW makefiles and so, unless we use // configure (which defines __WX_SETUP_H__) or it is explicitly overridden by // the user (who can define wxUSE_ZLIB_H_IN_PATH), we hardcode the path here -#if defined(__WXMSW__) && !defined(__WX_SETUP_H__) && !defined(wxUSE_ZLIB_H_IN_PATH) +#if defined(__WINDOWS__) && !defined(__WX_SETUP_H__) && !defined(wxUSE_ZLIB_H_IN_PATH) #include "../zlib/zlib.h" #else #include "zlib.h" diff --git a/src/msw/mimetype.cpp b/src/msw/mimetype.cpp index a067ac7de3..3fbbbe983e 100644 --- a/src/msw/mimetype.cpp +++ b/src/msw/mimetype.cpp @@ -36,7 +36,7 @@ #include "wx/iconloc.h" #include "wx/confbase.h" -#ifdef __WXMSW__ +#ifdef __WINDOWS__ #include "wx/msw/registry.h" #include "wx/msw/private.h" #endif // OS -- 2.45.2