[Libreoffice] compiling with C++0x support

Lionel Elie Mamane lionel at mamane.lu
Wed Nov 23 04:52:40 PST 2011


On Wed, Nov 23, 2011 at 12:27:20PM +0100, Jan Holesovsky wrote:

> On 2011-11-22 at 17:52 +0100, Lionel Elie Mamane wrote:

>> Kendy, would you consider having your MinGW tinderbox compile with
>> -std=c++0x or -std=gnu++0x? That would ensure coverage of Windows-only
>> code.

> I tried, but there were several places that were broken.  After I found
> out that M_PI is not defined when you build with -std=c++0x, I kind of
> lost interest for now ;-)


$ cat foo.c
#include <math.h>
$ g++-4.4 -std=c++0x -E -dM foo.c|grep 'M_PI '
#define M_PI 3.14159265358979323846
$ /usr/bin/i586-mingw32msvc-g++ -std=c++0x -E -dM foo.c|grep 'M_PI '
$

Sneaky, sneaky. Apparently, it is a bug that it is defined in *any*
strict ANSI/ISO mode, be it C or C++. Related to
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11196

But for this particular issue, note:

$ /usr/bin/i586-mingw32msvc-g++ -std=gnu++0x -E -dM foo.c|grep -i 'M_PI '
#define M_PI 3.14159265358979323846

So maybe you would have more luck with "-std=gnu++0x" than with
"-std=c++0x"?

-- 
Lionel


More information about the LibreOffice mailing list