Whamcloud - gitweb
ext2fs: work around FreeBSD header breakage
authorTheodore Ts'o <tytso@mit.edu>
Sat, 2 Jan 2016 01:12:22 +0000 (20:12 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Sat, 2 Jan 2016 01:12:22 +0000 (20:12 -0500)
commitd030908bfc424d492c10e6da94ae938e252093ef
tree8e5170bdd15119ce35b947d8e58dacaecb9cded5
parent19961cd0003564c63c33ec14e69dfec6d81a2238
ext2fs: work around FreeBSD header breakage

FreeBSD 10.2 will blow up compiling its own header files in sys/file.h
if _XOPEN_SOURCE is defined.

In file included from tdb.c:59:
/usr/include/sys/file.h:209:2: error: unknown type name 'u_int'
        u_int   xf_flag;        /* flags (see fcntl.h) */
                ^
1 error generated.

This is despite the fact that POSIX.1 requires comforming applications
to define _XOPEN_SOURCE (to different numbers depending on the version
of POSIX.1 the program is expecting to work against).  See section
2.2.1 in POSIX.1 for chapter and verse.

Work around this by removing the _XOPEN_SOURCE declaration.  This will
cause compiler warnings (and will cause builds against some versions
of Solaris to break), so only do this for FreeBSD.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
lib/ext2fs/tdb.c