Skip to content

Commit d9009e5

Browse files
committed
Define _GNU_SOURCE for RTEMS c++
Summary: This is required by the libc++ locale support. Reviewers: jyknight Subscribers: fedor.sergeev Differential Revision: https://reviews.llvm.org/D36121 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@309815 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent 759527f commit d9009e5

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

lib/Basic/Targets/OSTargets.h

+2
Original file line numberDiff line numberDiff line change
@@ -505,6 +505,8 @@ class LLVM_LIBRARY_VISIBILITY RTEMSTargetInfo : public OSTargetInfo<Target> {
505505

506506
Builder.defineMacro("__rtems__");
507507
Builder.defineMacro("__ELF__");
508+
if (Opts.CPlusPlus)
509+
Builder.defineMacro("_GNU_SOURCE");
508510
}
509511

510512
public:

test/Preprocessor/init.c

+1
Original file line numberDiff line numberDiff line change
@@ -8955,6 +8955,7 @@
89558955
// KFREEBSDI686-DEFINE:#define __GLIBC__ 1
89568956
//
89578957
// RUN: %clang_cc1 -x c++ -triple i686-pc-linux-gnu -fobjc-runtime=gcc -E -dM < /dev/null | FileCheck -match-full-lines -check-prefix GNUSOURCE %s
8958+
// RUN: %clang_cc1 -x c++ -triple sparc-rtems-elf -E -dM < /dev/null | FileCheck -match-full-lines -check-prefix GNUSOURCE %s
89588959
// GNUSOURCE:#define _GNU_SOURCE 1
89598960
//
89608961
// RUN: %clang_cc1 -x c++ -std=c++98 -fno-rtti -E -dM < /dev/null | FileCheck -match-full-lines -check-prefix NORTTI %s

0 commit comments

Comments
 (0)