diff --git a/CMakeLists.txt b/CMakeLists.txt index e91ed5507..9da4ca9a8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -312,18 +312,15 @@ if (MSVC) #$(SolutionDir)msvc,release:/OPT:ICF=5 #$(SolutionDir)msvc,release:/OPT:REF -else() +elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") add_definitions(-Wno-c++11-extensions) + add_definitions(-fcolor-diagnostics) endif() add_definitions(-D_FILE_OFFSET_BITS=64) add_definitions(-DBOOST_EXCEPTION_DISABLE) add_definitions(-DBOOST_ASIO_ENABLE_CANCELIO) -if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") - add_definitions(-fcolor-diagnostics) -endif() - if (tcmalloc) target_link_libraries(torrent-rasterbar tcmalloc) endif() diff --git a/src/alert.cpp b/src/alert.cpp index a047ee45c..9b6b725dd 100644 --- a/src/alert.cpp +++ b/src/alert.cpp @@ -1807,7 +1807,7 @@ namespace libtorrent { char ih_hex[41]; to_hex((const char*)&info_hash[0], 20, ih_hex); char msg[200]; - snprintf(msg, sizeof(msg), "incoming dht get_peers reply: %s, peers %ld", ih_hex, m_num_peers); + snprintf(msg, sizeof(msg), "incoming dht get_peers reply: %s, peers %d", ih_hex, m_num_peers); return msg; } diff --git a/src/asio_ssl.cpp b/src/asio_ssl.cpp index f762048e3..cea812335 100644 --- a/src/asio_ssl.cpp +++ b/src/asio_ssl.cpp @@ -13,6 +13,7 @@ // only define BOOST_ASIO_DECL if it hasn't already been defined // or if it has been defined to an empty string #if TORRENT_HAS_ASIO_DECL == x +#undef BOOST_ASIO_DECL #define BOOST_ASIO_DECL BOOST_SYMBOL_EXPORT #endif diff --git a/src/file.cpp b/src/file.cpp index d09e46612..513f86569 100644 --- a/src/file.cpp +++ b/src/file.cpp @@ -278,7 +278,10 @@ done: } } # else -# define _BSD_SOURCE +# undef _BSD_SOURCE +# define _BSD_SOURCE // deprecated since glibc 2.20 +# undef _DEFAULT_SOURCE +# define _DEFAULT_SOURCE # include # endif #endif