From 7bb871f9c2ea327ef832599fe77bdbf53f8008f7 Mon Sep 17 00:00:00 2001 From: Alan Antonuk Date: Fri, 21 May 2021 05:24:52 +0000 Subject: lib: delete obsolete inline keyword detection C99 supports the inline keyword, this is now not useful. Signed-off-by: GitHub --- CMakeLists.txt | 1 - cmake/TestCInline.cmake | 28 ---------------------------- cmake/config.h.in | 4 ---- 3 files changed, 33 deletions(-) delete mode 100644 cmake/TestCInline.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index f236451..826c15a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -37,7 +37,6 @@ if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo") endif() -include(TestCInline) include(CheckSymbolExists) include(CheckLibraryExists) include(CMakePushCheckState) diff --git a/cmake/TestCInline.cmake b/cmake/TestCInline.cmake deleted file mode 100644 index 6343646..0000000 --- a/cmake/TestCInline.cmake +++ /dev/null @@ -1,28 +0,0 @@ -#Inspired from http://www.cmake.org/Wiki/CMakeTestInline - -IF(NOT DEFINED C_INLINE_KEYWORD) - - SET(INLINE_TEST_SRC "/* Inspired by autoconf's c.m4 */ -static inline int static_foo() {return 0\;} -int main(int argc, char *argv[]){return 0\;} -") - - FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/CMakeTestCInline.c ${INLINE_TEST_SRC}) - - FOREACH(KEYWORD "inline" "__inline__" "__inline") - IF(NOT DEFINED C_INLINE) - TRY_COMPILE(C_HAS_${KEYWORD} - ${CMAKE_CURRENT_BINARY_DIR} - ${CMAKE_CURRENT_BINARY_DIR}/CMakeTestCInline.c - COMPILE_DEFINITIONS "-Dinline=${KEYWORD}" - ) - IF(C_HAS_${KEYWORD}) - SET(C_INLINE ${KEYWORD}) - ENDIF(C_HAS_${KEYWORD}) - ENDIF(NOT DEFINED C_INLINE) - ENDFOREACH(KEYWORD) - - SET(C_INLINE_KEYWORD ${C_INLINE} CACHE INTERNAL "The keyword needed by the C compiler to inline a function" FORCE) - message(STATUS "Found C inline keyword: ${C_INLINE_KEYWORD}") - -ENDIF(NOT DEFINED C_INLINE_KEYWORD) diff --git a/cmake/config.h.in b/cmake/config.h.in index ab49d5f..10b7d8a 100644 --- a/cmake/config.h.in +++ b/cmake/config.h.in @@ -1,10 +1,6 @@ #ifndef CONFIG_H #define CONFIG_H -#ifndef __cplusplus -# define inline ${C_INLINE_KEYWORD} -#endif - #cmakedefine HAVE_SELECT #cmakedefine HAVE_POLL -- cgit v1.2.1