From: Jan Andres Date: Sat, 31 Jan 2015 08:43:30 +0000 (+0100) Subject: processes: Fix build for Solaris 32-bit binary X-Git-Tag: collectd-5.5.0~12^2~4^2~3 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=242924c08dba2b8ffce9d82a38235f6d6710a136;p=collectd.git processes: Fix build for Solaris 32-bit binary Work around a #error in that occurs when building a 32-bit binary with _FILE_OFFSET_BITS=64. This uses a hack similar to the one in swap.c. --- diff --git a/src/processes.c b/src/processes.c index 8dd43e89..71295fe3 100644 --- a/src/processes.c +++ b/src/processes.c @@ -112,7 +112,22 @@ /* #endif HAVE_PROCINFO_H */ #elif KERNEL_SOLARIS +/* Hack: Avoid #error when building a 32-bit binary with + * _FILE_OFFSET_BITS=64. There is a reason for this #error, as one + * of the structures in uses an off_t, but that + * isn't relevant to our usage of procfs. */ +#if !defined(_LP64) && _FILE_OFFSET_BITS == 64 +# define SAVE_FOB_64 +# undef _FILE_OFFSET_BITS +#endif + # include + +#ifdef SAVE_FOB_64 +# define _FILE_OFFSET_BITS 64 +# undef SAVE_FOB_64 +#endif + # include /* #endif KERNEL_SOLARIS */