boostorg / thread

Boost.org thread module
http://boost.org/libs/thread
198 stars 162 forks source link

Error after including boost/thread/detail/platform_time.hpp #288

Open kkumar45 opened 5 years ago

kkumar45 commented 5 years ago

The header #include <boost/thread/detail/platform_time.hpp> has been added in Boost 1.69.0. It includes another header #include <mach/mach_time.h> which causes conflict on MAC OS when used with #include <llvm/Support/MachO.h>. Conflicts are for various identifier which are already defined in MachO.h.

Error : In the error below vm_prot.hgets included by mach_time.h (seen by generating preprocessor output)

llvm/Support/MachO.h:527:7: error: expected identifier
      VM_PROT_READ    = 0x1,
      ^
/Applications/Xcode10.1.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/mach/vm_prot.h:83:22: note: expanded from macro 'VM_PROT_READ'
#define VM_PROT_READ    ((vm_prot_t) 0x01)      /* read permission */

Sample program when compiled on MAC, generates the same error:

#include <boost/thread/detail/platform_time.hpp>
#include <llvm/Support/MachO.h>

int main()
{
    return 0;
}
kkumar45 commented 5 years ago

Can someone reproduce it?

viboes commented 4 years ago

Sorry, i have no accesos to machine.

could you provide a pr?

kkumar45 commented 4 years ago

@viboes Did you mean pull request containing fix for the issue? Could you please elaborate if you meant something else.

viboes commented 4 years ago

Yes a pull request