static inline const char *wine_dbgstr_guid( const GUID *id )
{
if (!id) return "(null)";
- if (!((ULONG_PTR)id >> 16)) return wine_dbg_sprintf( "<guid-0x%04lx>", (ULONG_PTR)id & 0xffff );
+ if (!((ULONG_PTR)id >> 16)) return wine_dbg_sprintf( "<guid-0x%04hx>", (WORD)(ULONG_PTR)id );
return wine_dbg_sprintf( "{%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}",
id->Data1, id->Data2, id->Data3,
id->Data4[0], id->Data4[1], id->Data4[2], id->Data4[3],
/* helper functions to manipulate the LDT_ENTRY structure */
static inline void wine_ldt_set_base( LDT_ENTRY *ent, const void *base )
{
- ent->BaseLow = (WORD)(unsigned long)base;
- ent->HighWord.Bits.BaseMid = (BYTE)((unsigned long)base >> 16);
- ent->HighWord.Bits.BaseHi = (BYTE)((unsigned long)base >> 24);
+ ent->BaseLow = (WORD)(ULONG_PTR)base;
+ ent->HighWord.Bits.BaseMid = (BYTE)((ULONG_PTR)base >> 16);
+ ent->HighWord.Bits.BaseHi = (BYTE)((ULONG_PTR)base >> 24);
}
static inline void wine_ldt_set_limit( LDT_ENTRY *ent, unsigned int limit )
{
static inline void *wine_ldt_get_base( const LDT_ENTRY *ent )
{
return (void *)(ent->BaseLow |
- (unsigned long)ent->HighWord.Bits.BaseMid << 16 |
- (unsigned long)ent->HighWord.Bits.BaseHi << 24);
+ (ULONG_PTR)ent->HighWord.Bits.BaseMid << 16 |
+ (ULONG_PTR)ent->HighWord.Bits.BaseHi << 24);
}
static inline unsigned int wine_ldt_get_limit( const LDT_ENTRY *ent )
{
/* C99 unaligned support */
+#ifndef UNALIGNED
#if defined(_MSC_VER) && (defined(_M_MRX000) || defined(_M_ALPHA) || defined(_M_PPC) || defined(_M_IA64) || defined(_M_AMD64))
# define UNALIGNED __unaligned
# ifdef _WIN64
# define UNALIGNED
# define UNALIGNED64
#endif
+#endif
/* Alignment macros */
# undef FD_SET
# undef FD_ZERO
# undef FD_ISSET
+# undef _TIMEVAL_DEFINED
# define WS_DEFINE_SELECT
# endif /* FD_CLR */
#else
typedef unsigned int WS_u_long;
#endif
-#elif (defined(_MSC_VER) || defined(__MINGW_H) || defined(__WATCOMC__)) && !defined(_BSDTYPES_DEFINED)
+#elif (defined(_MSC_VER) || defined(__MINGW32__) || defined(__WATCOMC__)) && !defined(_BSDTYPES_DEFINED)
/* MinGW doesn't define the u_xxx types */
typedef unsigned char u_char;
typedef unsigned short u_short;