]> git.ipfire.org Git - thirdparty/dbus.git/commitdiff
Add cmake check for HAVE_DDFD
authorRalf Habacker <ralf.habacker@freenet.de>
Sun, 21 Oct 2018 09:36:16 +0000 (11:36 +0200)
committerRalf Habacker <ralf.habacker@freenet.de>
Wed, 24 Oct 2018 08:03:30 +0000 (10:03 +0200)
Reviewed-by: Simon McVittie <smcv@collabora.com>
Bug: https://gitlab.freedesktop.org/dbus/dbus/merge_requests/18

cmake/ConfigureChecks.cmake
cmake/config.h.cmake

index cee6a9270ad608e233a1a0f81a106e2f79b1bca1..c14421ff6da9ecc58c85a5dc0c150501045c7e41 100644 (file)
@@ -160,6 +160,21 @@ int main(
 )
 " HAVE_DIRFD)
 
+if(NOT HAVE_DIRFD)
+    CHECK_C_SOURCE_COMPILES("
+    #include <sys/types.h>
+    #include <dirent.h>
+    int main()
+    {
+        DIR *dirp;
+        int fd;
+        dirp = opendir(\".\");
+        fd = dirp->dd_fd;
+        closedir(dirp);
+    }
+    " HAVE_DDFD)
+endif()
+
 # missing:
 # DBUS_HAVE_GCC33_GCOV
 
index 531bc8355bdfb06f00317010002404c77dbede94..f46454aaef116b870aba655615b7d0f2f5030b64 100644 (file)
 /* Have dirfd function */
 #cmakedefine HAVE_DIRFD 1
 
+/* Have the ddfd member of DIR */
+#cmakedefine HAVE_DDFD 1
+
 #cmakedefine HAVE_INOTIFY_INIT1 1
 #cmakedefine HAVE_GETRLIMIT 1
 #cmakedefine HAVE_PRCTL 1