[RFC] Operating system name/version detection

Thiago Macieira thiago at macieira.org
Thu Apr 10 14:23:15 PDT 2014


Em qui 10 abr 2014, às 20:57:02, Lubomir I. Ivanov escreveu:
> errors:
> ----------
> 3)
> 'WV_WINDOWS8_1' is not part of Qt 4.8.
> 
> i think it should be wrapped in:
> #if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
> ...
> #endif

Make that QT_VERSION_CHECK(5,2,0). It was added only last year.

> 1)
> 
> i don't think these are needed, as i don't see actual debug code or
> error handling:
> 
> #if !defined(Q_OS_WINCE)
> #include <errno.h>
> #if defined(Q_CC_MSVC)
> #include <crtdbg.h>
> #endif
> 
> also we don't really support MSVC.

Those come because he's copying from qglobal.cpp. While we don't do the error 
handling or debugging, I think we should leave the MSVC code around, for the 
future.

> 2)
> 
> i'm pretty sure that #ifdef Q_OS_UNIX will branch OSX as well, so
> perhaps Q_OS_MAC / Q_OS_LINUX have to be used.
> also a quick google search for similar code shows people not using
> "/etc/os-release" for OSX detection in favour of a shell script:
> "sw_vers -productVersion"

Hmm... the current code I have for Mac uses Gestalt(gestaltSystemVersion, ...) 
but that only returns the minor version of OS X, not the patch level.

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
   Software Architect - Intel Open Source Technology Center
      PGP/GPG: 0x6EF45358; fingerprint:
      E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358



More information about the subsurface mailing list