[Solaris] Only define _REENTRANT if -pthread

When looking at lib/Basic/Targets/OSTargets.h, I noticed that _REENTRANT is defined
unconditionally on Solaris, unlike all other targets and what either Studio cc (only define
it with -mt) or gcc (only define it with -pthread) do.

This patch follows that lead.

Differential Revision: https://reviews.llvm.org/D41241

llvm-svn: 332343
This commit is contained in:
Rainer Orth 2018-05-15 11:36:00 +00:00
parent 8f0ab258bd
commit 877d15b396
1 changed files with 2 additions and 1 deletions

View File

@ -551,7 +551,8 @@ protected:
Builder.defineMacro("_LARGEFILE_SOURCE");
Builder.defineMacro("_LARGEFILE64_SOURCE");
Builder.defineMacro("__EXTENSIONS__");
Builder.defineMacro("_REENTRANT");
if (Opts.POSIXThreads)
Builder.defineMacro("_REENTRANT");
if (this->HasFloat128)
Builder.defineMacro("__FLOAT128__");
}