]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
cmake: detect suseconds_t using CHECK_TYPE_SIZE
authorKefu Chai <kchai@redhat.com>
Mon, 26 Apr 2021 15:29:51 +0000 (23:29 +0800)
committerKefu Chai <kchai@redhat.com>
Sun, 2 May 2021 00:16:07 +0000 (08:16 +0800)
instead assuming it's a macro use CHECK_TYPE_SIZE to check it.

on Darwin, it's defined as `__darwin_suseconds_t`

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/CMakeLists.txt
src/include/config-h.in.cmake
src/log/LogClock.h

index 1d471473d1d71853dcc0264cdd69bfb7e0004401..d12e8b726db530460b9b0f641c5236dfecc56e57 100644 (file)
@@ -380,6 +380,11 @@ if(WITH_SEASTAR)
   add_subdirectory(crimson)
 endif()
 
+include(CheckTypeSize)
+set(CMAKE_EXTRA_INCLUDE_FILES "sys/time.h")
+CHECK_TYPE_SIZE(suseconds_t SUSECONDS_T)
+unset(CMAKE_EXTRA_INCLUDE_FILES)
+
 set(libcommon_files
   ${CMAKE_BINARY_DIR}/src/include/ceph_ver.h
   ceph_ver.c
index 504ff525ba94cae619cce94a4d886ef2a640e367..be9432db25d48e5f4a2fdb5f6598fce09ab79175 100644 (file)
@@ -66,6 +66,9 @@
 /* Define if the system has the type `in_addr_t' */
 #cmakedefine HAVE_IN_ADDR_T
 
+/* Define if you have suseconds_t */
+#cmakedefine HAVE_SUSECONDS_T
+
 /* Define if you have res_nquery */
 #cmakedefine HAVE_RES_NQUERY
 
index 07531c8e51a9f8223b60045314d8f73e0fdcf596..c7a4f33d6e453d4c21b537b58b29c81a625e4698 100644 (file)
@@ -12,7 +12,7 @@
 #include "include/ceph_assert.h"
 #include "common/ceph_time.h"
 
-#ifndef suseconds_t
+#ifndef HAVE_SUSECONDS_T
 typedef long suseconds_t;
 #endif