On quarta-feira, 15 de janeiro de 2014 19:25:45, Dirk Hohndel wrote: > On Wed, 2014-01-15 at 13:59 +0200, Lubomir I. Ivanov wrote: > > On 15 January 2014 10:30, Anton Lundin <[email protected]> wrote: > > > I had problems with this one on Qt5. > > > > this seems like a big change. could you elaborate why it was needed > > exactly? i think it would be preferable that we don't use stdbool for > > consistency with the C code. > > for example, things like process_dives() are C backend calls. > > I'll let Thiago speak on this with more authority, but it was my > understanding that true/false and TRUE/FALSE are intended to be > compatible...
Qt 4's qglobal.h defined TRUE and FALSE: # ifndef TRUE # define TRUE true # define FALSE false # endif Qt 5 does no such thing, they were removed in https://qt.gitorious.org/qt/qtbase/commit/158f39ec7870c54ff3a15f72fe151062d6daa172 Those macros had existed since Qt 1, from before the C++ standardisation, when some compilers did not have an actual bool type. We thought that they weren't needed in 2012 for C++ code. For Subsurface's C code, as long as we include C99's <stdbool.h>, we're fine. It does this in C mode: #define bool _Bool #define true 1 #define false 0 So for Subsurface code: use bool, true, false (all lowercase). -- 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
signature.asc
Description: This is a digitally signed message part.
_______________________________________________ subsurface mailing list [email protected] http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface
