CMake: support for system functions fsync/fdatasync

This commit is contained in:
Shahram Najm 2022-02-03 15:25:45 +00:00
parent bc36885685
commit ccf22c8648
2 changed files with 19 additions and 14 deletions

View File

@ -42,6 +42,8 @@ check_symbol_exists( posix_memalign "stdlib.h" ECCODES_HAVE_POSIX_MEMALIGN )
check_symbol_exists( fmemopen "stdio.h" ECCODES_HAVE_FMEMOPEN )
check_symbol_exists( funopen "stdio.h" ECCODES_HAVE_FUNOPEN )
check_symbol_exists( realpath "stdlib.h" ECCODES_HAVE_REALPATH )
check_symbol_exists( fsync "unistd.h" ECCODES_HAVE_FSYNC)
check_symbol_exists( fdatasync "unistd.h" ECCODES_HAVE_FDATASYNC)
check_c_source_compiles(
" typedef int foo_t;

View File

@ -51,6 +51,9 @@
#cmakedefine ECCODES_HAVE_FMEMOPEN
#cmakedefine ECCODES_HAVE_FUNOPEN
#cmakedefine ECCODES_HAVE_REALPATH
#cmakedefine ECCODES_HAVE_FSYNC
#cmakedefine ECCODES_HAVE_FDATASYNC
#cmakedefine ECCODES_ON_LINUX_32BIT
#if defined(EC_HAVE_ASSERT_H) || defined(ECCODES_HAVE_ASSERT_H)
#define HAVE_ASSERT_H 1