libarchive/libarchive
CMakeLists.txt
:1592
CHECK_C_SOURCE_COMPILES(
"#include <dirent.h>\nint main() {DIR *d = opendir(\".\"); return dirfd(d);}"
HAVE_DIRFD)
CHECK_C_SOURCE_COMPILES(
"#include <dirent.h>\nint main() {DIR *d = opendir(\".\"); return dirfd(d);}"
HAVE_DIRFD)
check_cxx_symbol_exists(dirfd "dirent.h" HAVE_DIRFD)
list(APPEND PLATFORM_DEFINITIONS HAVE_DIRFD)
add_definitions("-DANDROID=1" "-DANDROID_API_VERSION=24" "-DPUSH_NOTIFICATIONS=1" "-DANDROID" "-DLINUX" "-DUNIX" "-DHAVE_IPV6" "-DHAVE_DIRFD" "-DPROTO_DEBUG" "-DHAVE_ASSERT" "-DHAVE_GETLOGIN" "-DUSE_SELECT" "-D_FILE_OFFSET_BITS=64" "-DHAVE_OLD_SIGNALHANDLER" "-DHAVE_SCHED" "-DNO_SCM_RIGHTS" "-Wno-attributes" "-DAPP_VERSION=1.0.0" "-DAPP_VERSION_HEX=0x10000")
check_c_source_compiles("
#include <dirent.h>
int
main(int argc, char *argv[])
{
DIR *dirp = opendir(\"foo\");
int fd = -1;
if (dirp != NULL) {
fd = dirfd(dirp);
closedir(dirp);
}
return (fd == -1);
}
" HAVE_DIRFD)