Skip to content

Commit

Permalink
Fix some platform ifdef checks.
Browse files Browse the repository at this point in the history
  • Loading branch information
dsa-t committed Jun 1, 2024
1 parent 0336fdb commit cf7ad33
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 26 deletions.
2 changes: 1 addition & 1 deletion common/eda_base_frame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1611,7 +1611,7 @@ void EDA_BASE_FRAME::onIconize( wxIconizeEvent& aEvent )
}


#ifdef _WIN32
#ifdef __WXMSW__
WXLRESULT EDA_BASE_FRAME::MSWWindowProc( WXUINT message, WXWPARAM wParam, WXLPARAM lParam )
{
// This will help avoid the menu keeping focus when the alt key is released
Expand Down
4 changes: 2 additions & 2 deletions common/paths.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ wxString PATHS::GetStockDataPath( bool aRespectRunFromBuildDir )
}


#ifdef __WXMSW__
#ifdef _WIN32
/**
* Gets the stock (install) data path, which is the base path for things like scripting, etc
*/
Expand Down Expand Up @@ -485,7 +485,7 @@ wxString PATHS::GetOSXKicadDataDir()
#endif


#ifdef __WXMSW__
#ifdef _WIN32
wxString PATHS::GetWindowsFontConfigDir()
{
wxFileName fn;
Expand Down
2 changes: 1 addition & 1 deletion common/tool/action_menu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -653,7 +653,7 @@ wxMenuItem* ACTION_MENU::appendCopy( const wxMenuItem* aSource )
// On Windows, for Checkable Menu items, adding a bitmap adds also
// our predefined checked alternate bitmap
// On other OS, wxITEM_CHECK and wxITEM_RADIO Menu items do not use custom bitmaps.
#if defined( _WIN32 )
#if defined( __WXMSW__ )
// On Windows, AddBitmapToMenuItem() uses the unchecked bitmap for wxITEM_CHECK and
// wxITEM_RADIO menuitems and autoamtically adds a checked bitmap.
// For other menuitrms, use the "checked" bitmap.
Expand Down
12 changes: 2 additions & 10 deletions common/widgets/number_badge.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,19 +112,11 @@ void NUMBER_BADGE::SetTextSize( int aSize )

// OSX has prevalent badges in the application bar at the bottom of the screen so we try to
// match those. Other platforms may also need tweaks to spacing, fontweight, etc.
#ifdef __WXMAC__
#if defined( __WXMAC__ )
#define BADGE_FONTWEIGHT wxFONTWEIGHT_NORMAL
#define PLATFORM_FUDGE_X 0.92
#define PLATFORM_FUDGE_Y 1.6
#endif

#ifdef __WXGTK__
#define BADGE_FONTWEIGHT wxFONTWEIGHT_BOLD
#define PLATFORM_FUDGE_X 1.0
#define PLATFORM_FUDGE_Y 1.0
#endif

#ifdef __WXMSW__
#else
#define BADGE_FONTWEIGHT wxFONTWEIGHT_BOLD
#define PLATFORM_FUDGE_X 1.0
#define PLATFORM_FUDGE_Y 1.0
Expand Down
2 changes: 1 addition & 1 deletion include/eda_base_frame.h
Original file line number Diff line number Diff line change
Expand Up @@ -726,7 +726,7 @@ class EDA_BASE_FRAME : public wxFrame, public TOOLS_HOLDER, public KIWAY_HOLDER,
*/
virtual bool IsModal() const { return false; }

#ifdef _WIN32
#ifdef __WXMSW__
/**
* Windows specific override of the wxWidgets message handler for a window
*/
Expand Down
6 changes: 3 additions & 3 deletions include/gal/opengl/kiglew.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
// includes since they transitively include the OpenGL headers.
#define GL_SILENCE_DEPRECATION 1

#ifdef __WXGTK__
#if defined( __unix__ ) and not defined( __APPLE__ )

#ifdef KICAD_USE_EGL

Expand All @@ -58,12 +58,12 @@

#endif // KICAD_USE_EGL

#else // __WXGTK__
#else // defined( __unix__ ) and not defined( __APPLE__ )

// Non-GTK platforms only need the normal GLEW include
#include <GL/glew.h>

#endif // __WXGTK__
#endif // defined( __unix__ ) and not defined( __APPLE__ )

#ifdef _WIN32

Expand Down
4 changes: 2 additions & 2 deletions include/paths.h
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ class KICOMMON_API PATHS
static wxString GetOSXKicadDataDir();
#endif

#ifdef __WXMSW__
#ifdef _WIN32
/**
* @return The directory the font config support files can be found
*/
Expand Down Expand Up @@ -234,7 +234,7 @@ class KICOMMON_API PATHS
*/
static void getUserDocumentPath( wxFileName& aPath );

#ifdef __WXMSW__
#ifdef _WIN32
/**
* Gets the root of the kicad install on Windows specifically.
* KiCad on Windows has a pseudo posix folder structure contained in its installed folder
Expand Down
8 changes: 3 additions & 5 deletions kicad/pcm/pcm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -672,13 +672,11 @@ void PLUGIN_CONTENT_MANAGER::PreparePackage( PCM_PACKAGE& aPackage )
&& parse_version_tuple( *ver.kicad_version_max, 999 ) < m_kicad_version )
ver.compatible = false;

#ifdef __WXMSW__
#if defined( _WIN32 )
wxString platform = wxT( "windows" );
#endif
#ifdef __WXOSX__
#elif defined( __APPLE__ )
wxString platform = wxT( "macos" );
#endif
#ifdef __WXGTK__
#else
wxString platform = wxT( "linux" );
#endif

Expand Down
2 changes: 1 addition & 1 deletion scripting/python_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ void PYTHON_MANAGER::Execute( const wxString& aArgs,

wxString PYTHON_MANAGER::FindPythonInterpreter()
{
#ifdef __WXMSW__
#ifdef _WIN32
// TODO(JE) where
#else
wxArrayString output;
Expand Down

0 comments on commit cf7ad33

Please sign in to comment.