summaryrefslogtreecommitdiff
path: root/hw/xwin/win.h
diff options
context:
space:
mode:
authorAlexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de>2004-11-15 15:06:51 +0000
committerAlexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de>2004-11-15 15:06:51 +0000
commit9826b83826190e514ed115e15691ca015780f9bc (patch)
treee6ede7a76c2edc14ff3025fbc0fb65757327cde0 /hw/xwin/win.h
parentcecb668149e1956fb29bc89855182349122e2f4e (diff)
Bufzilla #1802, http://freedesktop.org/bugzilla/show_bug.cgi?id=1802 Added
mingw (Win32) port
Diffstat (limited to 'hw/xwin/win.h')
-rw-r--r--hw/xwin/win.h23
1 files changed, 19 insertions, 4 deletions
diff --git a/hw/xwin/win.h b/hw/xwin/win.h
index 759d18657..06155508f 100644
--- a/hw/xwin/win.h
+++ b/hw/xwin/win.h
@@ -139,8 +139,22 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <stdio.h>
+#ifndef HAS_SCPRINTF
+extern int scprintf(const char *format, ...);
+#else
+#ifdef WIN32
+#define scprintf _scprintf
+#endif
+#endif
+
+#ifndef __CYGWIN__
+#define sleep(x) Sleep(1000 * (x))
+#endif
+
#include <errno.h>
+#if defined(XWIN_MULTIWINDOWEXTWM) || defined(XWIN_CLIPBOARD) || defined(XWIN_MULTIWINDOW)
#include <pthread.h>
+#endif
#ifdef HAS_MMAP
#include <sys/mman.h>
@@ -220,11 +234,10 @@ if (fDebugProcMsg) \
char *pszTemp; \
int iLength; \
\
- iLength = sprintf (NULL, str, ##__VA_ARGS__); \
- \
+ iLength = scprintf (str, ##__VA_ARGS__); \
pszTemp = malloc (iLength + 1); \
- \
- sprintf (pszTemp, str, ##__VA_ARGS__); \
+ snprintf (pszTemp, iLength + 1, str, ##__VA_ARGS__); \
+ pszTemp[iLength] = 0; \
\
MessageBox (NULL, pszTemp, szFunctionName, MB_OK); \
\
@@ -626,7 +639,9 @@ typedef struct {
extern winScreenInfo g_ScreenInfo[];
extern miPointerScreenFuncRec g_winPointerCursorFuncs;
extern DWORD g_dwEvents;
+#ifdef HAS_DEVWINDOWS
extern int g_fdMessageQueue;
+#endif
extern int g_iScreenPrivateIndex;
extern int g_iCmapPrivateIndex;
extern int g_iGCPrivateIndex;