]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Portability: aio.h suffers from GCC-specific hacks on Linux 64-bit
authorAmos Jeffries <squid3@treenet.co.nz>
Sat, 9 Apr 2011 06:36:51 +0000 (18:36 +1200)
committerAmos Jeffries <squid3@treenet.co.nz>
Sat, 9 Apr 2011 06:36:51 +0000 (18:36 +1200)
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.

src/DiskIO/AIO/async_io.h

index 9eefc0891d4bc77b11a9353a7039d80b5ab41acf..bdcbb07de0551e9e389241f879ff860bdf6c4f2e 100644 (file)
@@ -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;