From 482eea48c70a29b908053263176318f75b96a173 Mon Sep 17 00:00:00 2001 From: OBATA Akio Date: Sun, 19 Jan 2020 18:33:37 +0900 Subject: [PATCH] Port ioctl prototype check to CMake Signed-off-by: OBATA Akio --- CMakeLists.txt | 4 ++++ config.h.cmake | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d224113..5b138b7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,6 +17,7 @@ cmake_minimum_required( VERSION 2.8 ) include( CheckCXXSourceCompiles ) include( CheckFunctionExists ) include( CheckSymbolExists ) +include( CheckPrototypeDefinition ) include( CheckIncludeFile ) include( CheckLibraryExists ) include( FindPkgConfig ) @@ -114,6 +115,9 @@ check_function_exists( memcpy HAVE_MEMCPY ) check_function_exists( bcopy HAVE_BCOPY ) set( CMAKE_REQUIRED_LIBRARIES ${bak_CMAKE_REQUIRED_LIBRARIES} ) unset( bak_CMAKE_REQUIRED_LIBRARIES ) +check_prototype_definition( ioctl "int ioctl(int d, int request, ...)" "-1" "unistd.h;sys/ioctl.h" HAVE_IOCTL_INT_INT_DOTS ) +check_prototype_definition( ioctl "int ioctl(int d, unsigned long request, ...)" "-1" "unistd.h;sys/ioctl.h" HAVE_IOCTL_INT_ULONG_DOTS ) +check_prototype_definition( ioctl "int ioctl(int d, unsigned long int request, ...)" "-1" "unistd.h;sys/ioctl.h" HAVE_IOCTL_INT_ULONGINT_DOTS ) ##### check for audiofile ####################### diff --git a/config.h.cmake b/config.h.cmake index efd9b36..f16dda7 100644 --- a/config.h.cmake +++ b/config.h.cmake @@ -40,7 +40,9 @@ #cmakedefine HAVE_SYS_SOUNDCARD_H 1 #cmakedefine HAVE_LIBPTHREAD 1 -#define HAVE_IOCTL_INT_ULONGINT_DOTS 3 +#cmakedefine HAVE_IOCTL_INT_INT_DOTS 1 +#cmakedefine HAVE_IOCTL_INT_ULONG_DOTS 2 +#cmakedefine HAVE_IOCTL_INT_ULONGINT_DOTS 3 #cmakedefine HAVE_LIBJACK 1 #cmakedefine HAVE_LIBSNDIO 1