chriskohlhoff / asio

Asio C++ Library
http://think-async.com/Asio
4.81k stars 1.2k forks source link

Fix `ASIO_ASSUME` definition on older compilers. #1271

Open Lastique opened 1 year ago

Lastique commented 1 year ago
  1. gcc 4.4 does not support __builtin_unreachable, which makes the __GNUC__ branch definition to fail.

  2. clang 3.5 doesn't support __builtin_assume and uses the last fallback option. There, ASIO_ASSUME is defined without arguments, meaning it expands to incorrect code like (void)0(base != 0). This also affects any other compilers that are not handled by prior branches.

Fixes https://github.com/chriskohlhoff/asio/issues/1270.

Please, also merge this to Boost before Boost.1.82 is released.