← Back to team overview

kicad-developers team mailing list archive

[PATCH] Wrong windows macro

 

Hi,

Quick patch for a misuse of __WXWINDOWS__ for checking the presence of
Windows. The correct macro is __WINDOWS__ or __WXMSW__ in GUI
programs.

__WXWINDOWS__ is always set, on all platforms.

The alternative is to remove the ifdef entirely, as this is not a big
issue to do on non-windows platforms, as it has been doing this
quietly since Feb 2018!

Cheers,

John

Ref: https://docs.wxwidgets.org/3.0/page_cppconst.html
From de2ea38e93b59e932a49d70e38eba05443b8b1aa Mon Sep 17 00:00:00 2001
From: John Beard <john.j.beard@xxxxxxxxx>
Date: Tue, 8 Jan 2019 17:50:06 +0000
Subject: [PATCH] __WXWINDOWS__ does not mean __WXMSW__

Misuse of __WXWINDOWS__ for checking the presence of Windows. The correct
macro is __WINDOWS__ or __WXMSW__ in GUI programs.

__WXWINDOWS__ is always set, on all platforms.
---
 common/widgets/indicator_icon.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/widgets/indicator_icon.cpp b/common/widgets/indicator_icon.cpp
index 97ef4fb0e..e777d8b57 100644
--- a/common/widgets/indicator_icon.cpp
+++ b/common/widgets/indicator_icon.cpp
@@ -75,7 +75,7 @@ wxImage createBlankImage( int size )
         for( int x = 0; x < size; ++x )
             image.SetAlpha( x, y, wxIMAGE_ALPHA_TRANSPARENT );
 
-#ifdef __WXWINDOWS__
+#ifdef __WXMSW__
     // wxWidgets on Windows chokes on an empty fully transparent bitmap and draws it
     // as a black box
     image.SetRGB( size / 2, size / 2, 128, 128, 128 );
-- 
2.20.1


Follow ups