diff options
author | marha <marha@users.sourceforge.net> | 2009-07-12 18:20:04 +0000 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2009-07-12 18:20:04 +0000 |
commit | da8fe31a7ba4acf109097d5696ad0145b991cdfd (patch) | |
tree | 1c74d6f075702a73e557872f2a6f020ea4eb5432 /xorg-server/os | |
parent | 6590f805a12779909cb8504c230fa367148fe38c (diff) | |
parent | 529dcfd0858d75cb3c87c73cb0f81dd20bbb9230 (diff) | |
download | vcxsrv-da8fe31a7ba4acf109097d5696ad0145b991cdfd.tar.gz vcxsrv-da8fe31a7ba4acf109097d5696ad0145b991cdfd.tar.bz2 vcxsrv-da8fe31a7ba4acf109097d5696ad0145b991cdfd.zip |
Changes for VC compilation
Diffstat (limited to 'xorg-server/os')
-rw-r--r-- | xorg-server/os/WaitFor.c | 6 | ||||
-rw-r--r-- | xorg-server/os/io.c | 1 | ||||
-rw-r--r-- | xorg-server/os/log.c | 6 | ||||
-rw-r--r-- | xorg-server/os/makefile | 4 | ||||
-rw-r--r-- | xorg-server/os/utils.c | 7 | ||||
-rw-r--r-- | xorg-server/os/xprintf.c | 12 | ||||
-rw-r--r-- | xorg-server/os/xstrans.c | 2 |
7 files changed, 36 insertions, 2 deletions
diff --git a/xorg-server/os/WaitFor.c b/xorg-server/os/WaitFor.c index da12976ca..0ce1db698 100644 --- a/xorg-server/os/WaitFor.c +++ b/xorg-server/os/WaitFor.c @@ -214,6 +214,12 @@ WaitForSomething(int *pClientsReady) wt = &waittime; } } + if (!wt) + { + wt = &waittime; + waittime.tv_sec = 0; + waittime.tv_usec = 100; + } XFD_COPYSET(&AllSockets, &LastSelectMask); #ifdef SMART_SCHEDULE } diff --git a/xorg-server/os/io.c b/xorg-server/os/io.c index e7ec60952..d32096704 100644 --- a/xorg-server/os/io.c +++ b/xorg-server/os/io.c @@ -945,6 +945,7 @@ FlushClient(ClientPtr who, OsCommPtr oc, char *extraBuf, int extraCount) /* If we've arrived here, then the client is stuffed to the gills and not ready to accept more. Make a note of it and buffer the rest. */ + errno=0; FD_SET(connection, &ClientsWriteBlocked); AnyClientsWriteBlocked = TRUE; diff --git a/xorg-server/os/log.c b/xorg-server/os/log.c index ee14624dc..282d2b97c 100644 --- a/xorg-server/os/log.c +++ b/xorg-server/os/log.c @@ -95,8 +95,14 @@ OR PERFORMANCE OF THIS SOFTWARE. #ifdef WIN32 #include <process.h> +#ifndef _MSC_VER #define getpid(x) _getpid(x) #endif +#endif + +#ifdef _MSC_VER +#define S_ISREG(m) (((m)&_S_IFMT) == _S_IFREG) +#endif #ifdef DDXOSVERRORF diff --git a/xorg-server/os/makefile b/xorg-server/os/makefile new file mode 100644 index 000000000..cf9eaf53f --- /dev/null +++ b/xorg-server/os/makefile @@ -0,0 +1,4 @@ +CSRCS=access.c auth.c backtrace.c connection.c io.c log.c mitauth.c os.c oscolor.c osinit.c rpcauth.c strlcat.c strlcpy.c utils.c WaitFor.c xdmauth.c xdmcp.c xprintf.c xstrans.c
+
+LIBRARY=libos
+
diff --git a/xorg-server/os/utils.c b/xorg-server/os/utils.c index f58c76366..f2b54d8dc 100644 --- a/xorg-server/os/utils.c +++ b/xorg-server/os/utils.c @@ -56,6 +56,7 @@ OR PERFORMANCE OF THIS SOFTWARE. #ifdef __CYGWIN__ #include <stdlib.h> #include <signal.h> +__stdcall unsigned long GetTickCount(void); #endif #if defined(WIN32) && !defined(__CYGWIN__) @@ -517,7 +518,7 @@ GiveUp(int sig) errno = olderrno; } -#if defined WIN32 && defined __MINGW32__ +#if (defined WIN32 && defined __MINGW32__) || defined(__CYGWIN__) _X_EXPORT CARD32 GetTimeInMillis (void) { @@ -1504,7 +1505,7 @@ XNFstrdup(const char *s) #ifdef SMART_SCHEDULE -#ifdef SIGVTALRM +#if defined(SIGVTALRM) && !defined(__CYGWIN__) #define SMART_SCHEDULE_POSSIBLE #endif @@ -1943,6 +1944,7 @@ Fclose(pointer iop) */ /* Consider LD* variables insecure? */ +#ifndef _MSC_VER #ifndef REMOVE_ENV_LD #define REMOVE_ENV_LD 1 #endif @@ -1951,6 +1953,7 @@ Fclose(pointer iop) #ifndef REMOVE_LONG_ENV #define REMOVE_LONG_ENV 1 #endif +#endif /* * Disallow stdout or stderr as pipes? It's possible to block the X server diff --git a/xorg-server/os/xprintf.c b/xorg-server/os/xprintf.c index 07eaa1f58..bf70661ac 100644 --- a/xorg-server/os/xprintf.c +++ b/xorg-server/os/xprintf.c @@ -39,7 +39,9 @@ # ifdef __va_copy # define va_copy __va_copy # else +# ifndef _MSC_VER # error "no working va_copy was found" +# endif # endif #endif @@ -48,11 +50,16 @@ Xvprintf(const char *format, va_list va) { char *ret; int size; + +#ifdef _MSC_VER + size = vsnprintf(NULL, 0, format, va); +#else va_list va2; va_copy(va2, va); size = vsnprintf(NULL, 0, format, va2); va_end(va2); +#endif ret = (char *)Xalloc(size + 1); if (ret == NULL) @@ -78,11 +85,16 @@ XNFvprintf(const char *format, va_list va) { char *ret; int size; + +#ifdef _MSC_VER + size = vsnprintf(NULL, 0, format, va); +#else va_list va2; va_copy(va2, va); size = vsnprintf(NULL, 0, format, va2); va_end(va2); +#endif ret = (char *)XNFalloc(size + 1); if (ret == NULL) diff --git a/xorg-server/os/xstrans.c b/xorg-server/os/xstrans.c index c086e225b..86c8688da 100644 --- a/xorg-server/os/xstrans.c +++ b/xorg-server/os/xstrans.c @@ -5,4 +5,6 @@ #define TRANS_REOPEN #define TRANS_SERVER #define XSERV_t +#define TCPCONN + #include <X11/Xtrans/transport.c> |