aboutsummaryrefslogtreecommitdiff
path: root/util.h
diff options
context:
space:
mode:
Diffstat (limited to 'util.h')
-rw-r--r--util.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/util.h b/util.h
index 3bc7c798a5..8fcfcd0dc9 100644
--- a/util.h
+++ b/util.h
@@ -84,6 +84,10 @@ inline void SetThreadPriority(int nThread, int nPriority) { setpriority(PRIO_PRO
#define THREAD_PRIORITY_NORMAL 0
#define THREAD_PRIORITY_ABOVE_NORMAL 0
#endif
+#ifndef MSG_NOSIGNAL
+#define MSG_NOSIGNAL 0
+#endif
+
@@ -379,6 +383,14 @@ inline int64 GetTimeMillis()
return wxGetLocalTimeMillis().GetValue();
}
+inline string DateTimeStrFormat(const char* pszFormat, int64 nTime)
+{
+ time_t n = nTime;
+ struct tm* ptmTime = gmtime(&n);
+ char pszTime[200];
+ strftime(pszTime, sizeof(pszTime), pszFormat, ptmTime);
+ return pszTime;
+}
@@ -400,7 +412,7 @@ inline void heapchk()
{ \
static char nLoops; \
if (nLoops <= 0) \
- nLoops = GetRand(50) + 1; \
+ nLoops = GetRand(20) + 1; \
if (nLoops-- > 1) \
{ \
ThreadFn; \