git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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
Previous: Jakub Narebski
Message 7 of 7 in “Building Git on Tru64”
  1. Building Git on Tru64Daniel Richard G., Apr 15, 2010
  2. Alex RiesenApr 15, 2010
  3. Daniel Richard G.Apr 15, 2010
  4. Nicolas PitreApr 15, 2010
  5. Daniel Richard G.Apr 15, 2010
  6. Jakub NarebskiApr 15, 2010
  7. Erik Faye-LundApr 16, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.