leveldb/port
costan b70493ca85 Fix fdatasync() feature detection in opensource build.
The CMake feature-detection code used check_symbol_exists(), which
invokes the C compiler. However, some glibc versions don't expose the
fdatasync() declaration when compiled with -std=c11, but do expose it
when compiled with -std=c++11. This most likely comes down to how
_POSIX_SOURCE is defined -- it needs to be >= 201112L for <unistd.h> to
expose fdatasync().

This CL switches to check_cxx_symbol_exists(), which uses the C++
compiler. Asides from fixing the problem above, this is the right thing
to do, because we use <unistd.h> in env_posix.cc, which is compiled with
the C++ compiler.

This CL also fixes a previously introduced inconsistency, where the
macro indicating the fdatasync() feature detection result was referred
to as HAVE_FDATASYNC and HAVE_FUNC_FDATASYNC. The former appears to be
used in other libraries, so this CL switches all our references to
HAVE_FDATASYNC.

Fixes https://github.com/google/leveldb/issues/629

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=228392612
2019-01-08 13:58:52 -08:00
..
win reverting disastrous MOE commit, returning to r21 2011-04-19 23:11:15 +00:00
atomic_pointer.h Take <atomic> for granted in port/atomic_pointer.h. 2018-03-21 09:40:40 -07:00
port_config.h.in Fix fdatasync() feature detection in opensource build. 2019-01-08 13:58:52 -08:00
port_example.h Remove InitOnce from the port API. 2018-09-10 19:04:59 -07:00
port_stdcxx.h Remove InitOnce from the port API. 2018-09-10 19:04:59 -07:00
port.h Replace port_posix with port_stdcxx. 2018-04-17 13:26:47 -07:00
README Replace port_posix with port_stdcxx. 2018-04-17 13:26:47 -07:00
thread_annotations.h Enable thread safety annotations in open source version. 2018-02-13 22:40:41 -08:00

This directory contains interfaces and implementations that isolate the
rest of the package from platform details.

Code in the rest of the package includes "port.h" from this directory.
"port.h" in turn includes a platform specific "port_<platform>.h" file
that provides the platform specific implementation.

See port_stdcxx.h for an example of what must be provided in a platform
specific header file.