Thread (7 messages) flat view 7 messages, 5 authors, 2016-06-15

Re: [PATCH] Building Git on Tru64

From: Erik Faye-Lund <hidden>
Date: 2016-06-15 22:48:39

On Thu, Apr 15, 2010 at 11:24 PM, Jakub Narebski [off-list ref] wrote:
"Daniel Richard G." [off-list ref] writes:
quoted
On Thu, 2010 Apr 15 21:29+0200, Alex Riesen wrote:
quoted
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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help