[SailfishDevel] Build with sailfish latest on mer-obs fails, QVariant, double (?)

Alejandro Exojo suy at badopi.org
Sun Jan 11 15:52:51 UTC 2015


El Thursday 08 January 2015, Kimmo Lindholm escribió:
> i had made a bad thing: (or bad copypaste)
> #define pi (3.14159)
> 
> in some other place someone else;
> QtMetaTypePrivate::QPairVariantInterfaceImpl pi
> =  v.value<QtMetaTypePrivate::QPairVariantInterfaceImpl>();
> 
> And seems that my #define messed things up.
> Now it builds correctly.

This is why #defines are a terrible idea when there are alternatives. First, 
the pi number is already defined as M_PI in math.h. Second, if you have to do 
that, and specify constants, use a "const double foo = ...". The compile 
errors (if any) will be much more meaningful.

-- 
Alex (a.k.a. suy) | GPG ID 0x0B8B0BC2
http://barnacity.net/ | http://disperso.net


More information about the Devel mailing list