Factor out platform detection from XRC code into wxPlatformId

This will allow reusing the same strings in other places.

Also use this as opportunity to add "msw" as the (preferred) synonym for
"win" for general consistency.
This commit is contained in:
Vadim Zeitlin
2021-02-02 17:03:20 +01:00
parent da45f88c53
commit 8293dcedef
4 changed files with 79 additions and 13 deletions

View File

@@ -42,6 +42,7 @@
#include "wx/hashset.h"
#include "wx/scopedptr.h"
#include "wx/config.h"
#include "wx/platinfo.h"
#include <limits.h>
#include <locale.h>
@@ -585,15 +586,7 @@ static void ProcessPlatformProperty(wxXmlNode *node)
while (tkn.HasMoreTokens())
{
s = tkn.GetNextToken();
#ifdef __WINDOWS__
if (s == wxT("win")) isok = true;
#endif
#if defined(__MAC__) || defined(__APPLE__)
if (s == wxT("mac")) isok = true;
#elif defined(__UNIX__)
if (s == wxT("unix")) isok = true;
#endif
isok = wxPlatformId::MatchesCurrent(tkn.GetNextToken());
if (isok)
break;