From: Amos Jeffries Date: Sat, 9 Apr 2011 06:36:51 +0000 (+1200) Subject: Portability: aio.h suffers from GCC-specific hacks on Linux 64-bit X-Git-Tag: take06~27^2~13 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=51d345d00e8d62f1bbb5772fc1eabc4453f3eb01;p=thirdparty%2Fsquid.git Portability: aio.h suffers from GCC-specific hacks on Linux 64-bit 64-bit file support on 32-bit systems uses GCC-specific #define to convert the functions to 64-bit API but omits the struct aiocb passed as paremeter. GCC seems not to mind, but non-GCC compilers barf on the invalid types. --- diff --git a/src/DiskIO/AIO/async_io.h b/src/DiskIO/AIO/async_io.h index 9eefc0891d..bdcbb07de0 100644 --- a/src/DiskIO/AIO/async_io.h +++ b/src/DiskIO/AIO/async_io.h @@ -32,7 +32,6 @@ typedef enum { AQ_ENTRY_WRITE } async_queue_entry_type_t; - typedef struct _async_queue_entry async_queue_entry_t; typedef struct _async_queue async_queue_t; @@ -45,7 +44,12 @@ struct _async_queue_entry { async_queue_entry_state_t aq_e_state; async_queue_entry_type_t aq_e_type; + /* 64-bit environments with non-GCC complain about the type mismatch on Linux */ +#if defined(__USE_FILE_OFFSET64) && !defined(__GNUC__) + struct aiocb64 aq_e_aiocb; +#else struct aiocb aq_e_aiocb; +#endif AIODiskFile *theFile; void *aq_e_callback_data; FREE *aq_e_free;