From b441bf70b53cc2f825b17844f61f690e3099ac79 Mon Sep 17 00:00:00 2001 From: Christopher Kohlhoff Date: Tue, 7 Nov 2017 06:54:32 +1100 Subject: [PATCH] Fix clang version detection for suppression of unused typedef warning. --- asio/include/asio/detail/config.hpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/asio/include/asio/detail/config.hpp b/asio/include/asio/detail/config.hpp index fa28be92..d0d4f3e8 100644 --- a/asio/include/asio/detail/config.hpp +++ b/asio/include/asio/detail/config.hpp @@ -1340,8 +1340,16 @@ #endif // defined(ASIO_NO_DEPRECATED) // Newer gcc, clang need special treatment to suppress unused typedef warnings. -#if defined(__clang__) && (__clang_major__ >= 7) -# define ASIO_UNUSED_TYPEDEF __attribute__((__unused__)) +#if defined(__clang__) +# if defined(__apple_build_version__) +# if (__clang_major__ >= 7) +# define ASIO_UNUSED_TYPEDEF __attribute__((__unused__)) +# endif // (__clang_major__ >= 7) +# elif ((__clang_major__ == 3) && (__clang_minor__ >= 6)) \ + || (__clang_major__ > 3) +# define ASIO_UNUSED_TYPEDEF __attribute__((__unused__)) +# endif // ((__clang_major__ == 3) && (__clang_minor__ >= 6)) + // || (__clang_major__ > 3) #elif defined(__GNUC__) # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 8)) || (__GNUC__ > 4) # define ASIO_UNUSED_TYPEDEF __attribute__((__unused__))