
On Tue, Feb 22, 2011 at 17:05, Roberto Bagnara bagnara@cs.unipr.it wrote:
On 02/22/2011 06:04 AM, Dongsheng Song wrote:
When I build on i686-w64-mingw32 target:
libtool: compile: i686-w64-mingw32-g++ -DHAVE_CONFIG_H -I. -I/home/oracle/src/ppl-0.11.1/src -I.. -I.. -I/home/oracle/src/ppl-0.11.1/src -I/home/oracle/tmp/gcc-4.5-windows-obj/misc//include -g -O2 -frounding-math -march=x86-64 -O2 -flto -pipe -D_WIN32 -W -Wall -MT fpu-ia32.lo -MD -MP -MF .deps/fpu-ia32.Tpo -c /home/oracle/src/ppl-0.11.1/src/fpu-ia32.cc -DDLL_EXPORT -DPIC -o .libs/fpu-ia32.o /home/oracle/src/ppl-0.11.1/src/fpu-ia32.cc: In function 'void Parma_Polyhedra_Library::detect_sse_unit()': /home/oracle/src/ppl-0.11.1/src/fpu-ia32.cc:52:7: error: 'NULL' was not declared in this scope make[3]: *** [fpu-ia32.lo] Error 1 make[3]: Leaving directory `/tmp/x/src' make[2]: *** [all] Error 2 make[2]: Leaving directory `/tmp/x/src' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/tmp/x' make: *** [all] Error 2
Here is my patch:
$ git diff src/fpu-ia32.cc diff --git a/src/fpu-ia32.cc b/src/fpu-ia32.cc index d361411..8a2a6a2 100644 --- a/src/fpu-ia32.cc +++ b/src/fpu-ia32.cc @@ -30,6 +30,7 @@ site: http://www.cs.unipr.it/ppl/ . */ #include "fpu.defs.hh" #include<csetjmp> #include<csignal> +#include<cstddef>
namespace {
Hi Dongsheng,
I don't see any occurrences of NULL in fpu-ia32.cc. Perhaps this is a bug in the <csetjmp> or related header file in your system?
When I use gcc 4.5 (version 4.5.3 20110221) with mingw-w64 trunk, after preprocessing, setjmp(env) extend to _setjmp3((env), NULL) .
When I use gcc 4.6 (version 4.6.0 20110221) with mingw-w64 trunk, after preprocessing, setjmp(env) extend to _setjmp3((env), __null) .
So gcc 4.5 run into trouble, but gcc 4.6 OK. I don't know why and how to fix in GCC or mingw-w64, but just add one line '#include<cstddef>' in the source is the simplest way.
-- Dongsheng