From 2d6753840038501ff2be16672e5e12e6ff90b0ad Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
Date: Wed, 19 Mar 2014 11:01:42 -0700
Subject: [PATCH 2/2] fts: allow _FILE_OFFSET_BITS=64 on 64-bit hosts
* io/fts.h: Use _Static_assert to check for _FILE_OFFSET_BITS problem,
so that we don't unnecessarily reject compilations with
_FILE_OFFSET_BITS=64 on 64-bit hosts.
---
ChangeLog | 5 +++++
io/fts.h | 8 +++++---
2 files changed, 10 insertions(+), 3 deletions(-)
@@ -1,5 +1,10 @@
2014-03-19 Paul Eggert <eggert@cs.ucla.edu>
+ fts: allow _FILE_OFFSET_BITS=64 on 64-bit hosts
+ * io/fts.h: Use _Static_assert to check for _FILE_OFFSET_BITS problem,
+ so that we don't unnecessarily reject compilations with
+ _FILE_OFFSET_BITS=64 on 64-bit hosts.
+
Approximate _Static_assert for pre-C11 compilers.
* misc/sys/cdefs.h (_Static_assert) [__STDC_VERSION__ < 201112L]:
New macro, for convenience with pre-C11 compilers.
@@ -35,10 +35,12 @@
#include <features.h>
#include <sys/types.h>
-/* The fts interface is incompatible with the LFS interface which
- transparently uses the 64-bit file access functions. */
+/* When off_t is not 64 bits, the fts interface is incompatible with
+ the LFS interface which transparently uses the 64-bit file access
+ functions. */
#ifdef __USE_FILE_OFFSET64
-# error "<fts.h> cannot be used with -D_FILE_OFFSET_BITS==64"
+_Static_assert (sizeof (__off_t) == sizeof (__off64_t),
+ "<fts.h> cannot be used with 64-bit off_t on this platform");
#endif
--
1.8.5.3