This is an archive of the discontinued LLVM Phabricator instance.

Add stdbool.h wrapper for libc++
ClosedPublic

Authored by EricWF on Jan 19 2016, 10:30 PM.

Details

Summary

According to the C++ standard <stdbool.h> isn't allowed to define true false or bool. However these macros are sometimes defined by the compilers stdbool.h.

Clang defines the macros whenever __STRICT_ANSI__ isn't defined (ie -std=gnu++11).
New GCC versions define the macros in C++03 mode only, older GCC versions (4.9 and before) always define the macros.

This patch adds a wrapper header for stdbool.h that undefs the required macros.

Diff Detail

Event Timeline

EricWF updated this revision to Diff 45351.Jan 19 2016, 10:30 PM
EricWF retitled this revision from to Add stdbool.h wrapper for libc++.
EricWF updated this object.
EricWF added reviewers: mclow.lists, rsmith.
EricWF added a subscriber: cfe-commits.
EricWF accepted this revision.Feb 19 2016, 4:20 PM
EricWF added a reviewer: EricWF.

Got approval from @mclow.lists offline.

This revision is now accepted and ready to land.Feb 19 2016, 4:20 PM
EricWF closed this revision.Feb 19 2016, 4:21 PM