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

@@ -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 <a href="http://en.wikipedia.org/wiki/Windows_User">Windows Controls</a>}
@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

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__

View File

@@ -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 <typeinfo>
#endif
#if !defined(__WXMSW__) || defined(__WXMICROWIN__)
#if !defined(__WINDOWS__) || defined(__WXMICROWIN__)
#include <signal.h> // 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;

View File

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

View File

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

View File

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

View File

@@ -23,7 +23,7 @@
#pragma hdrstop
#endif
#ifdef __WXMSW__
#ifdef __WINDOWS__
#include "wx/msw/msvcrt.h"
#endif

View File

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

View File

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

View File

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

View File

@@ -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 <io.h>
@@ -119,7 +119,7 @@
#define O_BINARY (0)
#endif //__UNIX__
#ifdef __WXMSW__
#ifdef __WINDOWS__
#include "wx/msw/mslu.h"
#endif

View File

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

View File

@@ -367,7 +367,7 @@ template<typename CharType>
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<typename T>
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:

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -46,7 +46,7 @@
#include <ctype.h>
// 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);

View File

@@ -43,7 +43,7 @@
#endif
// provide stubs for the systems not implementing these functions
#if !defined(__WXMSW__)
#if !defined(__WINDOWS__)
wxPowerType wxGetPowerType()
{

View File

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

View File

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

View File

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

View File

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

View File

@@ -50,7 +50,7 @@
#include "wx/stdpaths.h"
#include "wx/hashset.h"
#ifdef __WXMSW__
#ifdef __WINDOWS__
#include "wx/msw/wrapwin.h"
#endif

View File

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

View File

@@ -91,7 +91,7 @@
#include <sys/stat.h>
#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.:

View File

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

View File

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