[all-commits] [llvm/llvm-project] 44cc78: [libc++] Fix incorrect usage of __STDC_HOSTED__
hyd-dev via All-commits
all-commits at lists.llvm.org
Wed Sep 2 09:27:18 PDT 2020
Branch: refs/heads/master
Home: https://github.com/llvm/llvm-project
Commit: 44cc78da056fbda2693f0489275f8e0ff1f590a1
https://github.com/llvm/llvm-project/commit/44cc78da056fbda2693f0489275f8e0ff1f590a1
Author: hyd-dev <yd-huang at outlook.com>
Date: 2020-09-02 (Wed, 02 Sep 2020)
Changed paths:
M libcxx/include/__config
A libcxx/test/libcxx/libcpp_freestanding.sh.cpp
Log Message:
-----------
[libc++] Fix incorrect usage of __STDC_HOSTED__
D56913 introduced the _LIBCPP_FREESTANDING macro and guarded its
definition by:
#ifndef __STDC_HOSTED__
# define _LIBCPP_FREESTANDING
#endif
However, __STDC_HOSTED__ is defined as 0 in freestanding implementations
instead of undefined, which means that _LIBCPP_FREESTANDING would never
get defined. This patch corrects the above as:
#if __STDC_HOSTED__ == 0
# define _LIBCPP_FREESTANDING
#endif
Differential Revision: https://reviews.llvm.org/D86055
More information about the All-commits
mailing list