Skip to content

Commit

Permalink
fix X11/Xdg.h typedef collision fix
Browse files Browse the repository at this point in the history
  • Loading branch information
nfedera committed Feb 4, 2016
1 parent eadfff8 commit 099d488
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions winpr/include/winpr/wtypes.h.in
Expand Up @@ -101,14 +101,14 @@
#endif
#endif

#ifndef XMD_H /* X11/Xmd.h typedef collision with BOOL */
#if WINPR_HAVE_STDBOOL_H && !defined(__OBJC__)
typedef bool BOOL;
#else
#ifndef __OBJC__
#if defined(__APPLE__)
typedef signed char BOOL;
#else
#ifndef XMD_H
typedef int BOOL;
#endif
#endif
Expand All @@ -131,11 +131,14 @@ typedef unsigned long DWORD;
typedef unsigned long ULONG;
#endif

#ifndef XMD_H /* X11/Xmd.h typedef collision with BYTE */
#if WINPR_HAVE_STDINT_H
typedef uint8_t BYTE, *PBYTE, *LPBYTE;
typedef uint8_t BYTE;
#else
typedef unsigned char BYTE, *PBYTE, *LPBYTE;
typedef unsigned char BYTE;
#endif
#endif
typedef BYTE *PBYTE, *LPBYTE;

typedef BYTE BOOLEAN, *PBOOLEAN;
#if defined(wchar_t)
Expand Down Expand Up @@ -191,6 +194,8 @@ typedef HANDLE HMENU;

typedef DWORD HCALL;
typedef int INT, *LPINT;

#ifndef XMD_H /* X11/Xmd.h typedef collision with INT8, INT16, INT32 and INT64 */
#if WINPR_HAVE_STDINT_H
typedef int8_t INT8;
typedef int16_t INT16;
Expand All @@ -199,11 +204,11 @@ typedef int64_t INT64;
#else
typedef signed char INT8;
typedef signed short INT16;
#ifndef XMD_H
typedef signed int INT32;
typedef signed __int64 INT64;
#endif
#endif

typedef const WCHAR* LMCSTR;
typedef WCHAR* LMSTR;
typedef LONG *PLONG, *LPLONG;
Expand All @@ -218,10 +223,14 @@ typedef __uint3264 ULONG_PTR, *PULONG_PTR;

#if WINPR_HAVE_STDINT_H
typedef int32_t LONG32;
typedef int64_t LONG64;
#else
typedef signed int LONG32;
#ifndef XMD_H
#endif

#ifndef XMD_H /* X11/Xmd.h defines LONG64 */
#if WINPR_HAVE_STDINT_H
typedef int64_t LONG64;
#else
typedef signed __int64 LONG64;
#endif
#endif
Expand Down

0 comments on commit 099d488

Please sign in to comment.