Re: [PATCH] Building Git on Tru64

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Apr 15, 2010 at 11:24 PM, Jakub Narebski <jnareb@xxxxxxxxx> wrote:
> "Daniel Richard G." <skunk@xxxxxxxxxx> 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
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]