debuggers.hg
changeset 4591:e482f52f09bd
bitkeeper revision 1.1313 (42641d28jw3IBtr_TG4yEG9VDljPEw)
With -D_FORTIFY_SOURCE=2 (which is used in the Fedora buildroot), gcc has certain defines for functions like read() to check that things are done right.
This trips up these function pointers, and gcc becomes unhappy.
Adding parens around the function prevents gcc from expanding read to the macro it is defined to internally, and makes things compile again.
Signed-off-by: Rik van Riel <riel@redhat.com>
With -D_FORTIFY_SOURCE=2 (which is used in the Fedora buildroot), gcc has certain defines for functions like read() to check that things are done right.
This trips up these function pointers, and gcc becomes unhappy.
Adding parens around the function prevents gcc from expanding read to the macro it is defined to internally, and makes things compile again.
Signed-off-by: Rik van Riel <riel@redhat.com>
author | iap10@freefall.cl.cam.ac.uk |
---|---|
date | Mon Apr 18 20:48:40 2005 +0000 (2005-04-18) |
parents | 17dbcf9310c2 |
children | 3b3304b0c738 |
files | tools/libxutil/iostream.h |
line diff
1.1 --- a/tools/libxutil/iostream.h Mon Apr 18 19:58:08 2005 +0000 1.2 +++ b/tools/libxutil/iostream.h Mon Apr 18 20:48:40 2005 +0000 1.3 @@ -114,7 +114,7 @@ static inline int IOStream_read(IOStream 1.4 result = -EINVAL; 1.5 goto exit; 1.6 } 1.7 - result = stream->methods->read(stream, buf, n); 1.8 + result = (stream->methods->read)(stream, buf, n); 1.9 if(result > 0){ 1.10 stream->read += result; 1.11 } 1.12 @@ -139,7 +139,7 @@ static inline int IOStream_write(IOStrea 1.13 result = -EINVAL; 1.14 goto exit; 1.15 } 1.16 - result = stream->methods->write(stream, buf, n); 1.17 + result = (stream->methods->write)(stream, buf, n); 1.18 if(result > 0){ 1.19 stream->written += result; 1.20 } 1.21 @@ -157,7 +157,7 @@ static inline int IOStream_flush(IOStrea 1.22 if(stream->closed){ 1.23 result = IOSTREAM_EOF; 1.24 } else if(stream->methods->flush){ 1.25 - result = stream->methods->flush(stream); 1.26 + result = (stream->methods->flush)(stream); 1.27 if(result < 0) result = IOSTREAM_EOF; 1.28 } 1.29 return result; 1.30 @@ -171,7 +171,7 @@ static inline int IOStream_flush(IOStrea 1.31 static inline int IOStream_error(IOStream *stream){ 1.32 int err = 0; 1.33 if(stream->methods && stream->methods->error){ 1.34 - err = stream->methods->error(stream); 1.35 + err = (stream->methods->error)(stream); 1.36 } 1.37 return err; 1.38 } 1.39 @@ -184,7 +184,7 @@ static inline int IOStream_error(IOStrea 1.40 static inline int IOStream_close(IOStream *stream){ 1.41 int err = 1; 1.42 if(stream->methods && stream->methods->close){ 1.43 - err = stream->methods->close(stream); 1.44 + err = (stream->methods->close)(stream); 1.45 stream->closed = 1; 1.46 } 1.47 return err; 1.48 @@ -205,10 +205,10 @@ static inline int IOStream_is_closed(IOS 1.49 */ 1.50 static inline void IOStream_free(IOStream *stream){ 1.51 if(!stream->closed && stream->methods && stream->methods->close){ 1.52 - stream->methods->close(stream); 1.53 + (stream->methods->close)(stream); 1.54 } 1.55 if(stream->methods && stream->methods->free){ 1.56 - stream->methods->free(stream); 1.57 + (stream->methods->free)(stream); 1.58 } 1.59 *stream = (IOStream){}; 1.60 deallocate(stream);