From: Yang Tse Date: Fri, 14 Dec 2012 18:39:22 +0000 (+0100) Subject: setup_once.h: HP-UX issue workaround X-Git-Tag: curl-7_29_0~213 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0e8e340cba34837f89f393ec71bdaed2a4a02bf8;p=curl setup_once.h: HP-UX issue workaround Issue: When building a 32bit target with large file support HP-UX header file may simultaneously provide two different sets of declarations for sendfile and sendpath functions, one with static and another with external linkage. Given that we do not use mentioned functions we really don't care which linkage is the appropriate one, but on the other hand, the double declaration emmits warnings when using the HP-UX compiler and errors when using modern gcc versions resulting in fatal compilation errors. Mentioned issue is now fixed as long as we don't use sendfile nor sendpath functions. --- diff --git a/lib/setup_once.h b/lib/setup_once.h index effe14bc3..df28af2f8 100644 --- a/lib/setup_once.h +++ b/lib/setup_once.h @@ -87,10 +87,30 @@ #include #endif +#ifdef __hpux +# if !defined(_XOPEN_SOURCE_EXTENDED) || defined(_KERNEL) +# ifdef _APP32_64BIT_OFF_T +# define OLD_APP32_64BIT_OFF_T _APP32_64BIT_OFF_T +# undef _APP32_64BIT_OFF_T +# else +# undef OLD_APP32_64BIT_OFF_T +# endif +# endif +#endif + #ifdef HAVE_SYS_SOCKET_H #include #endif +#ifdef __hpux +# if !defined(_XOPEN_SOURCE_EXTENDED) || defined(_KERNEL) +# ifdef OLD_APP32_64BIT_OFF_T +# define _APP32_64BIT_OFF_T OLD_APP32_64BIT_OFF_T +# undef OLD_APP32_64BIT_OFF_T +# endif +# endif +#endif + /* * Definition of timeval struct for platforms that don't have it.