lhmouse / mcfgthread

Cornerstone of the MOST efficient std::thread on Windows for mingw-w64
https://gcc-mcf.lhmouse.com/
Other
277 stars 28 forks source link

restrict qualifier collision #19

Closed revelator closed 7 years ago

revelator commented 7 years ago

Been having trouble for some time with the restrict qualifier, and i suspected a bug with the mingw-w64 abi, but it turns out that mcfgthread redefines the qualifier in its own _crtdef.h which causes this error. So i changed it to use a guard in case its allready defined which seems to have alleviated the problem.

lhmouse commented 7 years ago

restrict itself is a keyword in C today but the C++ people don't seem to like it... GCC provides __restrict__ as an alternative that is available in both C and C++ and has the same meaning with the restrict keyword in C.

I was concerned that #define'ing restrict and nullptr would break some existent code because they aren't reserved identifiers... It turns out to be a bad choice I must acknowledge.

AFAIC the safest solution to this problem is using __restrict__ only in our code and removing that macro.

lhmouse commented 7 years ago

New commits pushed. Please test.

revelator commented 7 years ago

Will do, im making a build of the gcc-5.4.0 release which im going to stick to untill the problem with the hardcoded paths in gcc 6 are resolved.

Den 13-01-2017 kl. 17:48 skrev LH_Mouse:

New commits pushed. Please test.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/lhmouse/mcfgthread/issues/19#issuecomment-272485881, or mute the thread https://github.com/notifications/unsubscribe-auth/AB1zkJC4G2rIl917w0lePoYTwqZgQEzhks5rR6rvgaJpZM4LisJ3.

revelator commented 7 years ago

Seems to work so far :) codelite still bitches about restrict but that one seems to be simply because its using the qualifier incorrectly as an internal enumerator, so cant blame it on the former error. I made a patch to get around that one, but there are other problems with codelite which break it though.

Den 13-01-2017 kl. 17:48 skrev LH_Mouse:

New commits pushed. Please test.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/lhmouse/mcfgthread/issues/19#issuecomment-272485881, or mute the thread https://github.com/notifications/unsubscribe-auth/AB1zkJC4G2rIl917w0lePoYTwqZgQEzhks5rR6rvgaJpZM4LisJ3.

lhmouse commented 7 years ago

OK for closure?

revelator commented 7 years ago

Yep :) and thanks for fixing.

Den 15-01-2017 kl. 09:36 skrev LH_Mouse:

OK for closure?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/lhmouse/mcfgthread/issues/19#issuecomment-272681538, or mute the thread https://github.com/notifications/unsubscribe-auth/AB1zkAzOtb5O1lIFYxGI8i99dK-rqjrLks5rSdqYgaJpZM4LisJ3.