projects
/
gem5.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
types: add a type for thread IDs and try to use it everywhere
[gem5.git]
/
src
/
base
/
time.cc
diff --git
a/src/base/time.cc
b/src/base/time.cc
index cbc7256ee97944ea4c59a7c98516178dff45ecec..a1732773e026a0aa4bc066e1e0b788fde8598202 100644
(file)
--- a/
src/base/time.cc
+++ b/
src/base/time.cc
@@
-28,9
+28,9
@@
* Authors: Nathan Binkert
*/
* Authors: Nathan Binkert
*/
-#include <
sys/types.h
>
-#include <
sys/time.h
>
-#include <
time.h
>
+#include <
cctype
>
+#include <
cstring
>
+#include <
ctime
>
#include <iostream>
#include <string>
#include <iostream>
#include <string>
@@
-105,7
+105,11
@@
Time::date(string format) const
char buf[256];
if (format.empty()) {
char buf[256];
if (format.empty()) {
+#ifdef __SUNPRO_CC
+ ctime_r(&sec, buf, 256);
+#else
ctime_r(&sec, buf);
ctime_r(&sec, buf);
+#endif
buf[24] = '\0';
return buf;
}
buf[24] = '\0';
return buf;
}