Skip to content

include/compat: define aligned_free() as a function not a macro#47212

Merged
tchaikov merged 1 commit intoceph:mainfrom
tchaikov:wip-aligned-free
Jul 21, 2022
Merged

include/compat: define aligned_free() as a function not a macro#47212
tchaikov merged 1 commit intoceph:mainfrom
tchaikov:wip-aligned-free

Conversation

@tchaikov
Copy link
Contributor

@tchaikov tchaikov commented Jul 21, 2022

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

Contribution Guidelines

Checklist

  • Tracker (select at least one)
    • References tracker ticket
    • Very recent bug; references commit where it was introduced
    • New feature (ticket optional)
    • Doc update (no ticket needed)
    • Code cleanup (no ticket needed)
  • Component impact
    • Affects Dashboard, opened tracker ticket
    • Affects Orchestrator, opened tracker ticket
    • No impact that needs to be tracked
  • Documentation (select at least one)
    • Updates relevant documentation
    • No doc update is appropriate
  • Tests (select at least one)
Show available Jenkins commands
  • jenkins retest this please
  • jenkins test classic perf
  • jenkins test crimson perf
  • jenkins test signed
  • jenkins test make check
  • jenkins test make check arm64
  • jenkins test submodules
  • jenkins test dashboard
  • jenkins test dashboard cephadm
  • jenkins test api
  • jenkins test docs
  • jenkins render docs
  • jenkins test ceph-volume all
  • jenkins test ceph-volume tox
  • jenkins test windows

@tchaikov tchaikov mentioned this pull request Jul 21, 2022
14 tasks
@tchaikov tchaikov added cleanup win32 Specifix changes for the windows platform labels Jul 21, 2022
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>
@tchaikov
Copy link
Contributor Author

changelog

  • s/cstdlib/stdlib.h/ to be compatible with C source code .

@tchaikov
Copy link
Contributor Author

@tchaikov tchaikov merged commit dcd0541 into ceph:main Jul 21, 2022
@tchaikov tchaikov deleted the wip-aligned-free branch July 21, 2022 23:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cleanup win32 Specifix changes for the windows platform

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants