summaryrefslogtreecommitdiffstats
path: root/llvm/lib/System/Unix/TimeValue.inc
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2005-01-14 00:50:50 +0000
committerReid Spencer <rspencer@reidspencer.com>2005-01-14 00:50:50 +0000
commitcbeed3571a052e91d80ea95ad94d52ddc736ae51 (patch)
tree51c27820f22a19831832561497a92f0245e37115 /llvm/lib/System/Unix/TimeValue.inc
parent144f6e3deed9c3149b9922894cb167403306cc14 (diff)
downloadbcm5719-llvm-cbeed3571a052e91d80ea95ad94d52ddc736ae51.tar.gz
bcm5719-llvm-cbeed3571a052e91d80ea95ad94d52ddc736ae51.zip
Make asctime_r work for HP/UX.
llvm-svn: 19544
Diffstat (limited to 'llvm/lib/System/Unix/TimeValue.inc')
-rw-r--r--llvm/lib/System/Unix/TimeValue.inc4
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/System/Unix/TimeValue.inc b/llvm/lib/System/Unix/TimeValue.inc
index 8f0ad38d8ef..83d76d202c5 100644
--- a/llvm/lib/System/Unix/TimeValue.inc
+++ b/llvm/lib/System/Unix/TimeValue.inc
@@ -25,7 +25,11 @@ std::string TimeValue::toString() const {
char buffer[32];
time_t ourTime = time_t(this->toEpochTime());
+#ifdef __hpux
+ asctime_r(localtime(&ourTime), buffer);
+#else
::asctime_r(::localtime(&ourTime), buffer);
+#endif
std::string result(buffer);
return result.substr(0,24);
OpenPOWER on IntegriCloud