diff options
author | Pascal Bühler <pabuhler@cisco.com> | 2019-07-11 09:14:51 +0200 |
---|---|---|
committer | Pascal Bühler <pabuhler@cisco.com> | 2019-07-11 09:14:51 +0200 |
commit | adfe809d382658f158cf1e45616fd5bef132cf9c (patch) | |
tree | 89ab889ff7431cda0749566812f1d9dec6476f3e | |
parent | 3e29307f7acc651f2b6a68f0932dfc706b90f628 (diff) | |
download | libsrtp2-adfe809d382658f158cf1e45616fd5bef132cf9c.tar.gz |
if inline is not supported check for __inline
This preserves the exisiting behaviour if
config.h_win32vc7 was used.
-rw-r--r-- | CMakeLists.txt | 3 | ||||
-rw-r--r-- | config_in_cmake.h | 9 |
2 files changed, 10 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 0a22ac3..ed8c112 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -40,6 +40,9 @@ check_type_size("unsigned long" SIZEOF_UNSIGNED_LONG) check_type_size("unsigned long long" SIZEOF_UNSIGNED_LONG_LONG) check_c_source_compiles("inline void func(); void func() { } int main() { func(); return 0; }" HAVE_INLINE) +if(NOT HAVE_INLINE) + check_c_source_compiles("__inline void func(); void func() { } int main() { func(); return 0; }" HAVE___INLINE) +endif() set(ENABLE_DEBUG_LOGGING OFF CACHE BOOL "Enable debug logging in all modules") set(ERR_REPORTING_STDOUT OFF CACHE BOOL "Enable logging to stdout") diff --git a/config_in_cmake.h b/config_in_cmake.h index db52f0e..57e0864 100644 --- a/config_in_cmake.h +++ b/config_in_cmake.h @@ -103,8 +103,13 @@ /* The size of `unsigned long long', as computed by sizeof. */ @SIZEOF_UNSIGNED_LONG_LONG_CODE@ -/* Define to nothing, since the MSVC compiler doesn't support it. */ +/* Define inline to what is supported by compiler */ #cmakedefine HAVE_INLINE 1 +#cmakedefine HAVE___INLINE 1 #ifndef HAVE_INLINE -#define inline + #ifdef HAVE___INLINE + #define inline __inline + #else + #define inline + #endif #endif |