id summary reporter owner description type status milestone component version severity resolution keywords cc 10697 Boost coroutine leaks windows.h into global namespace jarmo.tiitto@… olli "I was surprised that file ""boost/coroutine/windows/protected_stack_allocator.hpp"" from coroutine library from boost release 1.56.0 version just insanely includes windows.h in public header without any protection from the header leaking into global namespace severely polluting it. Because of this 'boost/coroutine/protected_stack_allocator.hpp' is rendered UNUSABLE/BROKEN on windows (all compilers) and namespace pollution may apply to Unix/Linux as well. The feature is released very hacky and unfinished way by having such code issues. To fix this cleanly simplest thing would be to contain and move windows.h (or other platform depend) inclusion into a .cpp file which is compiled. The file ""boost/coroutine//protected_stack_allocator.hpp"" would contain function prototypes something like: {{{ void * allocate_protected_memory(size_t) void free_protected_memory(void *) }}} in boost::detail namespace to just allocate protected stack memory area (no original pointer adjusting) and the protected_stack_allocator template that uses the function prototypes. The compiled file then implements the prototypes and the platform depend stuff would be hidden from library user. " Bugs closed Boost 1.57.0 coroutine Boost 1.56.0 Problem worksforme windows.h coroutine namespace any