• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2 
3 Copyright 1996, 1998  The Open Group
4 
5 Permission to use, copy, modify, distribute, and sell this software and its
6 documentation for any purpose is hereby granted without fee, provided that
7 the above copyright notice appear in all copies and that both that
8 copyright notice and this permission notice appear in supporting
9 documentation.
10 
11 The above copyright notice and this permission notice shall be included
12 in all copies or substantial portions of the Software.
13 
14 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15 OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL-
16 ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT
17 SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABIL-
18 ITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
20 IN THE SOFTWARE.
21 
22 Except as contained in this notice, the name of The Open Group shall
23 not be used in advertising or otherwise to promote the sale, use or
24 other dealings in this Software without prior written authorization from
25 The Open Group.
26 
27 */
28 
29 /*
30  * This header file has the sole purpose of allowing the inclusion of
31  * windows.h without getting any name conflicts with X headers code, by
32  * renaming the conflicting definitions from windows.h
33  *
34  * Some (non-Microsoft) versions of the Windows API headers actually avoid
35  * making the conflicting definitions if XFree86Server is defined, so we
36  * need to remember if that was defined and undefine it during including
37  * windows.h (so the conflicting definitions get wrapped correctly), and
38  * then redefine it afterwards...
39  *
40  * There doesn't seem to be a good way to wrap the min/max macros from
41  * windows.h, so we simply avoid defining them completely, allowing any
42  * pre-existing definition to stand.
43  *
44  */
45 
46 #undef _XFree86Server
47 #ifdef XFree86Server
48 # define _XFree86Server
49 # undef XFree86Server
50 #endif
51 
52 #define NOMINMAX
53 #define BOOL wBOOL
54 #define INT32 wINT32
55 #undef Status
56 #define Status wStatus
57 #define ATOM wATOM
58 #define BYTE wBYTE
59 #define FreeResource wFreeResource
60 #include <windows.h>
61 #undef NOMINMAX
62 #undef Status
63 #define Status int
64 #undef BYTE
65 #undef BOOL
66 #undef INT32
67 #undef ATOM
68 #undef FreeResource
69 #undef CreateWindowA
70 
71 #ifdef RESOURCE_H
72 # undef RT_FONT
73 # undef RT_CURSOR
74 # define RT_FONT         ((RESTYPE)4)
75 # define RT_CURSOR       ((RESTYPE)5)
76 #endif
77 
78 #ifndef __CYGWIN__
79 #define sleep(x) Sleep((x) * 1000)
80 #endif
81 
82 #if defined(WIN32) && (!defined(PATH_MAX) || PATH_MAX < 1024)
83 # undef PATH_MAX
84 # define PATH_MAX 1024
85 #endif
86 
87 #ifdef _XFree86Server
88 # define XFree86Server
89 # undef _XFree86Server
90 #endif
91 
92