summaryrefslogtreecommitdiff
path: root/os
diff options
context:
space:
mode:
authorLuo Jie <luojie@nlsde.buaa.edu.cn>2007-05-24 11:02:28 -0700
committerEric Anholt <eric@anholt.net>2007-05-24 11:30:22 -0700
commit0b988450462ddb005311e68502357baf272e6371 (patch)
treeec379e2420a79d1f9ee2aaf9bb8ceb0859b53c1a /os
parent1f48995d66c0072caa7e5ce2845be642221dd56d (diff)
Fix os/utils.c compile with mingw.
Diffstat (limited to 'os')
-rw-r--r--os/utils.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/os/utils.c b/os/utils.c
index 5058285e8..dd5acd34b 100644
--- a/os/utils.c
+++ b/os/utils.c
@@ -64,8 +64,10 @@ OR PERFORMANCE OF THIS SOFTWARE.
#include <X11/Xos.h>
#include <stdio.h>
#include <time.h>
+#if !defined(WIN32) || !defined(__MINGW32__)
#include <sys/time.h>
#include <sys/resource.h>
+#endif
#include "misc.h"
#include <X11/X.h>
#define XSERV_t
@@ -527,6 +529,13 @@ GiveUp(int sig)
errno = olderrno;
}
+#if defined WIN32 && defined __MINGW32__
+_X_EXPORT CARD32
+GetTimeInMillis (void)
+{
+ return GetTickCount ();
+}
+#else
_X_EXPORT CARD32
GetTimeInMillis(void)
{
@@ -541,6 +550,7 @@ GetTimeInMillis(void)
X_GETTIMEOFDAY(&tv);
return(tv.tv_sec * 1000) + (tv.tv_usec / 1000);
}
+#endif
_X_EXPORT void
AdjustWaitForDelay (pointer waitTime, unsigned long newdelay)
@@ -798,11 +808,13 @@ ProcessCommandLine(int argc, char *argv[])
}
else if ( strcmp( argv[i], "-core") == 0)
{
- struct rlimit core_limit;
CoreDump = TRUE;
+#if !defined(WIN32) || !defined(__MINGW32__)
+ struct rlimit core_limit;
getrlimit (RLIMIT_CORE, &core_limit);
core_limit.rlim_cur = core_limit.rlim_max;
setrlimit (RLIMIT_CORE, &core_limit);
+#endif
}
else if ( strcmp( argv[i], "-dpi") == 0)
{