Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:14:36

0001 /*
0002 
0003 Copyright 1996, 1998  The Open Group
0004 
0005 Permission to use, copy, modify, distribute, and sell this software and its
0006 documentation for any purpose is hereby granted without fee, provided that
0007 the above copyright notice appear in all copies and that both that
0008 copyright notice and this permission notice appear in supporting
0009 documentation.
0010 
0011 The above copyright notice and this permission notice shall be included
0012 in all copies or substantial portions of the Software.
0013 
0014 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
0015 OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL-
0016 ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT
0017 SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABIL-
0018 ITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
0019 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
0020 IN THE SOFTWARE.
0021 
0022 Except as contained in this notice, the name of The Open Group shall
0023 not be used in advertising or otherwise to promote the sale, use or
0024 other dealings in this Software without prior written authorization from
0025 The Open Group.
0026 
0027 */
0028 
0029 /*
0030  * This header file has the sole purpose of allowing the inclusion of
0031  * windows.h without getting any name conflicts with X headers code, by
0032  * renaming or disabling the conflicting definitions from windows.h
0033  */
0034 
0035 /*
0036  * Mingw.org versions of the Windows API headers actually avoid
0037  * making the conflicting definitions if XFree86Server is defined, so we
0038  * need to remember if that was defined and undefine it during including
0039  * windows.h (so the conflicting definitions get wrapped correctly), and
0040  * then redefine it afterwards. (This was never the correct thing to
0041  * do as it's no help at all to X11 clients which also need to use the
0042  * Win32 API)
0043  */
0044 #undef _XFree86Server
0045 #ifdef XFree86Server
0046 # define _XFree86Server
0047 # undef XFree86Server
0048 #endif
0049 
0050 /*
0051  * There doesn't seem to be a good way to wrap the min/max macros from
0052  * windows.h, so we simply avoid defining them completely, allowing any
0053  * pre-existing definition to stand.
0054  *
0055  */
0056 #define NOMINMAX
0057 
0058 /*
0059  * mingw-w64 headers define BOOL as a typedef, protecting against macros
0060  * mingw.org headers define BOOL in terms of WINBOOL
0061  * ... so try to come up with something which works with both :-)
0062  */
0063 #define _NO_BOOL_TYPEDEF
0064 #define BOOL WINBOOL
0065 #define INT32 wINT32
0066 #ifdef __x86_64__
0067 #define INT64 wINT64
0068 #define LONG64 wLONG64
0069 #endif
0070 #undef Status
0071 #define Status wStatus
0072 #define ATOM wATOM
0073 #define BYTE wBYTE
0074 #define FreeResource wFreeResource
0075 #include <windows.h>
0076 #undef NOMINMAX
0077 #undef Status
0078 #define Status int
0079 #undef BYTE
0080 #undef BOOL
0081 #undef INT32
0082 #undef INT64
0083 #undef LONG64
0084 #undef ATOM
0085 #undef FreeResource
0086 #undef CreateWindowA
0087 
0088 /*
0089  * Older version of this header used to name the windows API bool type wBOOL,
0090  * rather than more standard name WINBOOL
0091  */
0092 #define wBOOL WINBOOL
0093 
0094 #ifdef RESOURCE_H
0095 # undef RT_FONT
0096 # undef RT_CURSOR
0097 # define RT_FONT         ((RESTYPE)4)
0098 # define RT_CURSOR       ((RESTYPE)5)
0099 #endif
0100 
0101 #ifndef __CYGWIN__
0102 #define sleep(x) Sleep((x) * 1000)
0103 #endif
0104 
0105 #if defined(WIN32) && (!defined(PATH_MAX) || PATH_MAX < 1024)
0106 # undef PATH_MAX
0107 # define PATH_MAX 1024
0108 #endif
0109 
0110 #ifdef _XFree86Server
0111 # define XFree86Server
0112 # undef _XFree86Server
0113 #endif
0114