From: Amos Jeffries Date: Mon, 18 Apr 2011 11:51:49 +0000 (-0600) Subject: Portability: glob.h requires GCC to compile on Linux. X-Git-Tag: SQUID_3_1_12_1~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4fbe3afbfbf90640387ff780c55b692346a7e39b;p=thirdparty%2Fsquid.git Portability: glob.h requires GCC to compile on Linux. --- diff --git a/compat/os/linux.h b/compat/os/linux.h index 21f6663b4b..b5e93283c0 100644 --- a/compat/os/linux.h +++ b/compat/os/linux.h @@ -44,6 +44,29 @@ typedef uint32_t __u32; #include #endif /* HAVE_SYS_CAPABILITY_H */ +/* + * glob.h is provided by GNU on Linux and contains some unavoidable preprocessor + * logic errors in its 64-bit definitions which are hit by non-GCC compilers. + * + * #if __USE_FILE_OFFSET64 && __GNUC__ < 2 + * # define glob glob64 + * #endif + * #if !defined __USE_FILE_OFFSET64 || __GNUC__ < 2 + * extern "C" glob(...); + * #endif + * extern "C" glob64(...); + * + * ... and multiple "C" definitions of glob64 refuse to compile. + * Because __GNUC__ being undefined equates to 0 and (0 < 2) + */ +#if __USE_FILE_OFFSET64 && __GNUC__ < 2 +#if HAVE_GLOB_H +#undef HAVE_GLOB_H +#endif +#if HAVE_GLOB +#undef HAVE_GLOB +#endif +#endif #endif /* _SQUID_LINUX_ */ #endif /* SQUID_OS_LINUX_H */