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
This commit is contained in:
Vadim Zeitlin
2012-03-04 00:29:31 +00:00
parent 2e3407de5c
commit d98a58c543
55 changed files with 192 additions and 193 deletions

View File

@@ -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)
// ------------------------------------------------------------------------

View File

@@ -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

View File

@@ -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__) || \

View File

@@ -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

View File

@@ -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

View File

@@ -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__
// ----------------------------------------------------------------------------

View File

@@ -18,7 +18,7 @@
# include <iosfwd>
#endif
#ifdef __WXMSW__
#ifdef __WINDOWS__
# include "wx/msw/winundef.h"
#endif

View File

@@ -21,7 +21,7 @@
#include "wx/afterstd.h"
#ifdef __WXMSW__
#ifdef __WINDOWS__
# include "wx/msw/winundef.h"
#endif

View File

@@ -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

View File

@@ -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

View File

@@ -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))))

View File

@@ -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__)

View File

@@ -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

View File

@@ -23,7 +23,7 @@
#define wxFSWatchEntry wxFSWatchEntryKq
WX_DECLARE_STRING_HASH_MAP(wxSharedPtr<wxFSWatchEntry>,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<wxFSWatchEntry>,wxFSWatchEntries);

View File

@@ -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

View File

@@ -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 <sys/time.h> // 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"

View File

@@ -289,7 +289,7 @@ bool wxPrintfConvSpec<CharType>::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<CharType>::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'):

View File

@@ -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"

View File

@@ -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"

View File

@@ -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)

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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"

View File

@@ -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__