From: Erwin W. <wat...@xs...> - 2012-08-03 08:36:36
|
Op 3-8-2012 10:23, ef...@io... schreef: > > there is one thing I can't understand: > Compiling with -std=c99, WIN32 is not defined, so keeping the #ifdef, do not > include win headers, and so generate error because HANDLE is not defined. > Compiling with -std=gnu99 (or nothing as is the default), WIN32 is defined, so > the #ifdef doesn't matter, compile well. > > It is a wanted behavior WIN32 is defined only with gnu extention over strict > C99? > > thank you, > Valerio > > I did not know that, but I can confirm you are right: waterlan@erwin2 ~/tmp $ echo > t.c waterlan@erwin2 ~/tmp $ gcc -E -dM t.c |grep WIN32 #define _WIN32 1 #define __WIN32 1 #define __WIN32__ 1 #define WIN32 1 waterlan@erwin2 ~/tmp $ gcc -std=gnu99 -E -dM t.c |grep WIN32 #define _WIN32 1 #define __WIN32 1 #define __WIN32__ 1 #define WIN32 1 waterlan@erwin2 ~/tmp $ gcc -std=c99 -E -dM t.c |grep WIN32 #define _WIN32 1 #define __WIN32 1 #define __WIN32__ 1 -- Erwin Waterlander http://waterlan.home.xs4all.nl/ |