aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/os/utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/os/utils.c')
-rwxr-xr-x[-rw-r--r--]xorg-server/os/utils.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/xorg-server/os/utils.c b/xorg-server/os/utils.c
index 2945e3e1b..e4c87bacd 100644..100755
--- a/xorg-server/os/utils.c
+++ b/xorg-server/os/utils.c
@@ -71,6 +71,10 @@ __stdcall unsigned long GetTickCount(void);
#if !defined(WIN32) || !defined(__MINGW32__)
#include <sys/time.h>
#include <sys/resource.h>
+# define SMART_SCHEDULE_POSSIBLE
+#endif
+#ifdef _MSC_VER
+# define SMART_SCHEDULE_POSSIBLE
#endif
#include "misc.h"
#include <X11/X.h>
@@ -217,7 +221,7 @@ static HANDLE s_hSmartScheduleTimerQueue = NULL;
OsSigHandlerPtr
OsSignal(int sig, OsSigHandlerPtr handler)
{
-#ifdef X_NOT_POSIX
+#if defined(WIN32) && !defined(__CYGWIN__)
return signal(sig, handler);
#else
struct sigaction act, oact;
@@ -918,6 +922,7 @@ ProcessCommandLine(int argc, char *argv[])
i = skip - 1;
}
#endif
+#ifdef SMART_SCHEDULE_POSSIBLE
else if (strcmp(argv[i], "-dumbSched") == 0) {
SmartScheduleDisable = TRUE;
}
@@ -936,6 +941,7 @@ ProcessCommandLine(int argc, char *argv[])
else
UseMsg();
}
+#endif
else if (strcmp(argv[i], "-render") == 0) {
if (++i < argc) {
int policy = PictureParseCmapPolicy(argv[i]);
@@ -1144,6 +1150,7 @@ XNFstrdup(const char *s)
void
SmartScheduleStopTimer(void)
{
+#ifdef SMART_SCHEDULE_POSSIBLE
#ifdef _MSC_VER
if (SmartScheduleDisable)
return;
@@ -1160,6 +1167,7 @@ SmartScheduleStopTimer(void)
timer.it_value.tv_usec = 0;
(void) setitimer(ITIMER_REAL, &timer, 0);
#endif
+#endif
}
#ifdef _MSC_VER
@@ -1175,6 +1183,7 @@ static void SmartScheduleTimer (int sig)
void
SmartScheduleStartTimer(void)
{
+#ifdef SMART_SCHEDULE_POSSIBLE
#ifdef _MSC_VER
if (SmartScheduleDisable)
return;
@@ -1199,11 +1208,13 @@ SmartScheduleStartTimer(void)
timer.it_value.tv_usec = SmartScheduleInterval * 1000;
setitimer(ITIMER_REAL, &timer, 0);
#endif
+#endif
}
void
SmartScheduleInit(void)
{
+#ifdef SMART_SCHEDULE_POSSIBLE
#ifdef _MSC_VER
if (SmartScheduleDisable)
return;
@@ -1231,6 +1242,7 @@ SmartScheduleInit(void)
SmartScheduleDisable = TRUE;
}
#endif
+#endif
}
#ifdef SIG_BLOCK
@@ -1286,12 +1298,10 @@ OsBlockSIGIO(void)
sigprocmask(SIG_BLOCK, &set, &PreviousSigIOMask);
ret = sigismember(&PreviousSigIOMask, SIGIO);
return ret;
- } else
+ }
#endif
- return 1;
-#else
- return 1;
#endif
+ return 1;
}
void