[Development] Proposition for a new Q_OS_ define

Tomasz Siekierda sierdzio at gmail.com
Sat Mar 23 22:04:29 CET 2013


On 23 March 2013 01:51, Jake Thomas Petroules
<jake.petroules at petroules.com> wrote:
> I'd like to suggest that we add a new Q_OS_ define.
>
> Currently, for Apple platforms, we have:
>
> Q_OS_DARWIN
> Q_OS_DARWIN32
> Q_OS_DARWIN64
> Q_OS_IOS
> Q_OS_MAC
> Q_OS_MAC32
> Q_OS_MAC64
> Q_OS_MACX
>
> The first three are very straightforward. Q_OS_DARWIN is defined for both
> Apple platforms, OS X and iOS, with specific defines for 32 and 64 bit. iOS
> -- also straightforward; means iOS.
>
> Then we get confusing. You'd think Q_OS_MAC is defined for OS X only, but
> it's just a synonym for Darwin, which makes it mostly useless. Further
> confusing is Q_OS_MACX which even more strongly implies that  it refers to
> OS X, but again it's simply a synonym for Darwin.
>
> This results in a ton of #if defined(Q_OS_MAC) && !defined(Q_OS_IOS), which
> is very counterproductive. I propose that we add a Q_OS_OSX define (and
> Q_OS_OSX32 / Q_OS_OSX64) which is only defined for OS X. This would be quite
> helpful, I think.
>
> Any objections? If not, dev or stable?

Sounds good to me, although adding another macro might just confuse
people even more.



More information about the Development mailing list