hw/xwin: Remove unused X includes from internal.h and add them where needed

Also removing server headers we might clash with and no longer need.  Make
a few adjustments to allow for this change:

- provide a prototype of ErrorF()
- use the MAX() macro provided by sys/param.h, not the max() macro provided by misc.h
- use the X 'Bool' type rather than the unwrapped Windows 'BOOL' type

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
This commit is contained in:
Jon TURNEY 2013-06-20 12:50:18 +01:00
parent 52f3cf3c61
commit cbe133752d
4 changed files with 11 additions and 11 deletions

View File

@ -33,10 +33,7 @@
#define WINCLIPBOARD_INTERNAL_H
/* X headers */
#include <X11/X.h>
#include <X11/Xatom.h>
#include <X11/Xproto.h>
#include <X11/Xutil.h>
#include <X11/Xlib.h>
/* Windows headers */
#include <X11/Xwindows.h>
@ -59,7 +56,7 @@
*/
extern void winDebug(const char *format, ...);
extern void winErrorFVerb(int verb, const char *format, ...);
extern void ErrorF(const char *format, ...);
/*
* winclipboardtextconv.c
@ -89,7 +86,7 @@ typedef struct
* winclipboardwndproc.c
*/
BOOL winClipboardFlushWindowsMessageQueue(HWND hwnd);
Bool winClipboardFlushWindowsMessageQueue(HWND hwnd);
LRESULT CALLBACK
winClipboardWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);

View File

@ -41,6 +41,7 @@
#include <fcntl.h>
#include <setjmp.h>
#include <pthread.h>
#include <sys/param.h> // for MAX() macro
#ifdef HAS_WINSOCK
#include <X11/Xwinsock.h>
@ -48,7 +49,7 @@
#include <errno.h>
#endif
#include "misc.h"
#include <X11/Xatom.h>
#include <X11/extensions/Xfixes.h>
#include "winclipboard.h"
#include "internal.h"
@ -185,7 +186,7 @@ winClipboardProc(Bool fUseUnicode, char *szDisplay)
}
/* Find max of our file descriptors */
iMaxDescriptor = max(fdMessageQueue, iConnectionNumber) + 1;
iMaxDescriptor = MAX(fdMessageQueue, iConnectionNumber) + 1;
#else
iMaxDescriptor = iConnectionNumber + 1;
#endif

View File

@ -37,8 +37,9 @@
#include <sys/types.h>
#include <sys/time.h>
#include <X11/Xatom.h>
#include "internal.h"
#include "misc.h"
#include "winclipboard.h"
/*
@ -499,7 +500,7 @@ winClipboardWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
* Process any pending Windows messages
*/
BOOL
Bool
winClipboardFlushWindowsMessageQueue(HWND hwnd)
{
MSG msg;

View File

@ -35,7 +35,8 @@
#endif
#include "internal.h"
#include "misc.h"
#include <X11/Xutil.h>
#include <X11/Xatom.h>
#include <X11/extensions/Xfixes.h>
/*