From: Erik Faye-Lund Date: Fri, 16 Apr 2010 06:58:00 GMT Subject: Re: [PATCH] Building Git on Tru64 Message-ID: In-Reply-To: On Thu, Apr 15, 2010 at 11:24 PM, Jakub Narebski wrote: > "Daniel Richard G." writes: > >> On Thu, 2010 Apr 15 21:29+0200, Alex Riesen wrote: >> > >> > That one may be better handled at one place (git-compat-util.h?) with >> > something like: >> > >> >   #ifdef Tru64 >> >   #define MAP_FAILED ((void *)MAP_FAILED) >> >   #endif >> >> I agree with the sentiment, but you can't have a macro refer to itself > > It can.  From (cpp.info) > >  3.10.5 Self-Referential Macros >  ------------------------------ > >    It is passed into the >  preprocessor output unchanged. > Not very useful in this case, no? $ echo "#define MAP_FAILED (-1L) #define MAP_FAILED ((void *)MAP_FAILED) void *v = MAP_FAILED" | gcc -x c - :2:1: warning: "MAP_FAILED" redefined :1:1: warning: this is the location of the previous definition :3: error: 'MAP_FAILED' undeclared here (not in a function) :3: error: expected ',' or ';' at end of input $ echo "#define MAP_FAILED (-1L) #define MAP_FAILED ((void *)MAP_FAILED) void *v = MAP_FAILED" | cpp # 1 "" # 1 "" # 1 "" # 1 "" :2:1: warning: "MAP_FAILED" redefined :1:1: warning: this is the location of the previous definition void *v = ((void *)MAP_FAILED) $ -- Erik "kusma" Faye-Lund