kicad-developers team mailing list archive
-
kicad-developers team
-
Mailing list archive
-
Message #18067
Re: Strange wxWidgets version checks
Le 26/04/2015 06:41, Blair Bonnett a écrit :
> Hi all,
>
> I've been going through the code removing redundant conditionally compiled
> blocks for versions of wxWidgets before 3.0 as per the 'Conversion to
> wxWidgets 3.0' section of the roadmap [1]. For the most part this is
> straightforward as the wxCHECK_VERSION macro is used which makes the intent
> clear. However I have run into a couple of cases using the major and minor
> constants in a strange way which I want to run past the list first in case
> my assumptions are wrong.
>
> First, on common/draw_panel.cpp line 933 [2]:
>
> #if wxMAJOR_VERSION >= 2 && wxMINOR_VERSION >= 9
> int axis = event.GetWheelAxis();
> #else
> const int axis = 0;
> #endif
>
> As it stands, this will be true for wxWidgets 2.9, 3.9, 3.10, 4.9 etc. I'm
> pretty sure this is supposed to be checking for wxWidgets >= 2.9 since, as
> far as I can tell, that was when GetWheelAxis() was added.
>
> The second one is on line 32 of include/dialog_shim.h [3]:
>
> #if wxMINOR_VERSION == 8 && defined(__WXGTK__)
> #define DLGSHIM_USE_SETFOCUS 1
> #else
> #define DLGSHIM_USE_SETFOCUS 0
> #endif
>
> I'm less sure about what this one is checking for. I suspect the #else case
> can always be used (my guess is its meant to be either checking for version
> == 2.8 or version < 3) as when it is set to 1 it overrides a wx function,
> and presumably is doing so for backwards compatibility. Can somebody
> confirm that for me?
>
> If somebody can confirm or correct my assumptions about these two, then
> I'll be able to finish testing the changes and submit a patch.
>
> Thanks,
> Blair
Looks like bugs for me.
Besides, the wxWidgets minimal version is now 3.0.0
( I am pretty sure Kicad cannot be built with previous versions )
--
Jean-Pierre CHARRAS
References