Re: [PATCH] Building Git on Tru64
- From
Erik Faye-Lund <kusmabite@googlemail.com>
- Date
- Apr 16, 2010, 06:58 UTC
- Message-ID
- <h2y40aa078e1004152358s66299ef9p55d454902113c7d4@mail.gmail.com>
- In-Reply-To
- <m34ojcfly1.fsf@localhost.localdomain>
On Thu, Apr 15, 2010 at 11:24 PM, Jakub Narebski <jnareb@gmail.com> wrote:
Show 21 quoted lines
> "Daniel Richard G." <skunk@iSKUNK.ORG> 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 > ------------------------------ > > <snip> 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 - <stdin>:2:1: warning: "MAP_FAILED" redefined <stdin>:1:1: warning: this is the location of the previous definition <stdin>:3: error: 'MAP_FAILED' undeclared here (not in a function) <stdin>: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 "<stdin>" # 1 "<built-in>" # 1 "<command-line>" # 1 "<stdin>" <stdin>:2:1: warning: "MAP_FAILED" redefined <stdin>:1:1: warning: this is the location of the previous definition
void *v = ((void *)MAP_FAILED) $
-- Erik "kusma" Faye-Lund