diff options
author | Mihai Moldovan <ionic@ionic.de> | 2018-01-09 01:08:17 +0100 |
---|---|---|
committer | Mihai Moldovan <ionic@ionic.de> | 2018-01-09 01:08:17 +0100 |
commit | 1086c4aa5b4ad65bb51dac1dbab606f14ebaf98b (patch) | |
tree | 1365ea718d79998976bfab487b596ef48ce34b0c /nxcomp/src/Timestamp.h | |
parent | 70e1e6a011126aa027456ad4b3163f67d72c034f (diff) | |
parent | 2eb2f2e6ca13d84113e30041ade2dbfa9f4e1432 (diff) | |
download | nx-libs-1086c4aa5b4ad65bb51dac1dbab606f14ebaf98b.tar.gz nx-libs-1086c4aa5b4ad65bb51dac1dbab606f14ebaf98b.tar.bz2 nx-libs-1086c4aa5b4ad65bb51dac1dbab606f14ebaf98b.zip |
Merge branch 'Ionic-bugfix/ctime' into 3.6.x
Attributes GH PR #623: https://github.com/ArcticaProject/nx-libs/pull/623
Fixes: ArcticaProject/nx-libs#616
Diffstat (limited to 'nxcomp/src/Timestamp.h')
-rw-r--r-- | nxcomp/src/Timestamp.h | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/nxcomp/src/Timestamp.h b/nxcomp/src/Timestamp.h index bb9b243db..9e6fafcfd 100644 --- a/nxcomp/src/Timestamp.h +++ b/nxcomp/src/Timestamp.h @@ -26,11 +26,17 @@ #ifndef Timestamp_H #define Timestamp_H +#if HAVE_CTIME_S +#define __STDC_WANT_LIB_EXT1__ 1 +#include <time.h> +#endif /* HAVE_CTIME_S */ + #include <stdio.h> #include <stdlib.h> #include <string.h> +#include <iostream> +#include <string> -#include <time.h> #include <sys/time.h> #include "Misc.h" @@ -260,15 +266,15 @@ inline int checkDiffTimestamp(const T_timestamp &ts1, const T_timestamp &ts2, // Return a string representing the timestamp. // -char *strTimestamp(const T_timestamp &ts); -char *strMsTimestamp(const T_timestamp &ts); +std::string strTimestamp(const T_timestamp &ts); +std::string strMsTimestamp(const T_timestamp &ts); -inline char *strTimestamp() +inline std::string strTimestamp() { return strTimestamp(getTimestamp()); } -inline char *strMsTimestamp() +inline std::string strMsTimestamp() { return strMsTimestamp(getTimestamp()); } |