Having a general FRAMEWORK_X_Y define wouldn't be bad. But maybe every
FRAMEWORK_X_Y should read as "FRAMEWORK_X_Y_OR_ABOVE" since every framework
is compatible to its ancestors. Still I would keep these defines:

* MONO := set when build for Mono
* MONO_X_Y := set when built for Mono
* DOTNET := set when built for the .NET framework

Of course DOTNET and MONO defines cannot coexist. Further, building for a
newer .NET framework should define all other frameworks since every future
framework will be compatible to all ancestors. For example while building
for .NET 4.0 the following defines should be set:

{FRAMEWORK_2_0_OR_ABOVE, FRAMEWORK_3_0_OR_ABOVE, FRAMEWORK_3_5_OR_ABOVE,
FRAMEWORK_4_0_OR_ABOVE, DOTNET}

At least this eases code maintenance.

Despite all this, I'm not sure if we need something like FRAMEWORK_X_Y_ONLY.
This would need further evaluation based on the current codebase.

Opinions?

>-----Ursprüngliche Nachricht-----
>Von: Stefan Bodewig [mailto:bode...@apache.org]
>Gesendet: Montag, 4. November 2013 06:31
>An: log4net-dev@logging.apache.org
>Betreff: Changed some defines
>
>Hi all,
>
>I have removed all defines that correspond to frameworks trunk no longer
>builds and also dropped the *_2_0 symbols as they are the default now -
>on that way I've removed a few chunks of 1.x specific code.
>
>For the Compact Framework 2.0 build I'll ask Dustin Jones, the reporter
>of LOG4NET-399 to verify I haven't broken things.
>
>Also I changed NET_3_5 and NET_4_0 to FRAMEWORK_3_5 and
>FRAMEWORK_4_0,
>the idea is that we reuse those symbols for Mono as well and make it
>switch on API versions rather than implementations.  Does that make
>sense?
>
>Unfortunately I somehow missed the introduction of NET_3_5 which was not
>part of the build setup.  This means the 3.5 builds of 1.2.12 do no
>contain the ILog extension methods.  In new trunk builds they now do,
>which also means the 3.5 version is now really different from the 2.0
>one.
>
>Finally I'm thinking about defining FRAMEWORK_3_5 for the net-4.0 build
>as well so
>
>#if FRAMEWORK_3_5 || FRAMEWORK_4_0
>
>could be collapsed to
>
>#if FRAMEWORK_3_5
>
>and each conditional could just use the one version the required feature
>has first been added in.
>
>Stefan

Reply via email to