Lars Gullik Bjønnes a écrit :
Abdelrazak Younes <[EMAIL PROTECTED]> writes:

| Jean-Marc Lasgouttes a écrit :
| >>>>>> "Abdelrazak" == Abdelrazak Younes <[EMAIL PROTECTED]> writes:
| >>>>>>
| >
| > Abdelrazak> Tested 1.4 Does not compile on qt4 (and I guess also on
| > Abdelrazak> qt3), remove the last bracket:
| >
| > Doh! Thanks.
| >
| > Abdelrazak> This is why I hate #ifdef, they should be banished from
| > Abdelrazak> normal code.
| >
| > We should banish the windows port, then.
| >
| This was friday man...
| Beside, Windows does not require #ifdef, programming style does. I
| would prefer loosing a few cpu cycle with an "if (os.platform() ==
| WIN32)". This way, we are sure that we don't miss any compiling
| errors, same for MAC.

You don't have to depromote compiletime checks to runtime checks to
accomplish that.

#define WINDOWS_PORT 1

if (WINDOWS_PORT) {
        // Win specific stuff
}

Will be pruned compile time if WINDOWS_PORT does not evaluate to true.

Good idea.

But I tend to find this kind of casing, be it comile- or run-time bad.

/me too.

Abdel.

Reply via email to