]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
include/compat: define aligned_free() as a function not a macro 47212/head
authorKefu Chai <tchaikov@gmail.com>
Thu, 21 Jul 2022 16:09:33 +0000 (00:09 +0800)
committerKefu Chai <tchaikov@gmail.com>
Thu, 21 Jul 2022 16:28:58 +0000 (00:28 +0800)
commit6d0b28bb84ce39b64414742fb9b49ea3b1d6c2ec
tree51bc1d349201975f3ec51a0a87e60d9881485709
parentf877a4f3eb6e01328b286fd456585456d27d0f3a
include/compat: define aligned_free() as a function not a macro

so it does not get substituted by the preprocessor unconditionally.
this change helps to address the compiling failure when using boost
1.79 using MinGW, like:

../build.deps/mingw/boost/include/boost/align/aligned_allocator.hpp: In member function 'void boost::alignment::aligned_allocator<T, Alignment>::deallocate(boost::alignment::aligned_allocator<T, Alignment>::pointer, boost::alignment::aligned_allocator<T, Alignment>::size_type)':
../src/include/compat.h:352:27: error: '_aligned_free' is not a member of 'boost::alignment'; did you mean 'aligned_free'?
  352 | #define aligned_free(ptr) _aligned_free(ptr)
      |                           ^~~~~~~~~~~~~

Signed-off-by: Kefu Chai <tchaikov@gmail.com>
src/include/compat.h