--- fpx/fpxlibio.cpp.orig 2007-11-02 08:10:05.000000000 +0100 +++ fpx/fpxlibio.cpp 2013-09-09 13:56:54.668936912 +0200 @@ -151,7 +151,7 @@ theFPXStr = NULL; return FPX_MEMORY_ALLOCATION_FAILED; } - unsigned short *pt = theFPXStr->ptr; + LPWSTR pt = theFPXStr->ptr; while (i--) *pt++ = *string++; *pt = 0; @@ -165,7 +165,7 @@ int FPX_WideStrcmp (const FPXWideStr* fpxWStr1, const FPXWideStr* fpxWStr2) { size_t cnt1, cnt2, limit; - unsigned short *ptr1, *ptr2; + LPWSTR ptr1, ptr2; cnt1 = fpxWStr1->length; cnt2 = fpxWStr2->length; --- fpxlib.h.orig 2013-09-09 13:53:29.039950715 +0200 +++ fpxlib.h 2013-09-09 13:55:26.857942727 +0200 @@ -38,10 +38,15 @@ } CLIPDATA; #if !defined(WCHAR) && !defined(__BORLANDC__) +#if defined(HAVE_WCHAR_H) + typedef wchar_t WCHAR; + typedef wchar_t WORD; +#else typedef uint16_t WCHAR; + typedef uint16_t WORD; +#endif typedef WCHAR *LPWSTR; #endif - typedef uint16_t WORD; typedef uint32_t DWORD; /*************************************************************************** @@ -81,7 +86,7 @@ typedef struct FPXWideStr { size_t length; /* length of string off ptr in bytes */ - uint16_t *ptr; /* Inside fpxlib wchar_t is 2-bytes XXX */ + LPWSTR ptr; /* Inside fpxlib wchar_t is 2-bytes XXX */ } FPXWideStr; typedef struct { --- ole/oleprop.cpp.orig 2007-11-02 08:10:05.000000000 +0100 +++ ole/oleprop.cpp 2013-09-09 12:40:04.255254017 +0200 @@ -169,6 +169,7 @@ //------------------------------------------------------------------------------------- OLEProperty::operator short() const { return short(V_I2(&val)); } +OLEProperty::operator unsigned short() const { return (unsigned short)(V_I2(&val)); } OLEProperty::operator WORD() const { return (WORD)(V_I2(&val)); } OLEProperty::operator DWORD() const { return (DWORD)(V_I4(&val)); } OLEProperty::operator int() const { return int(V_I4(&val)); } --- ole/oleprop.h.orig 2007-11-02 08:10:05.000000000 +0100 +++ ole/oleprop.h 2013-09-09 12:39:36.849256304 +0200 @@ -125,6 +125,7 @@ // Following functions define the VT data types in variant.h that can be extracted // from an OLEProperty class through operator= virtual operator short() const; + virtual operator unsigned short() const; virtual operator WORD() const; virtual operator DWORD() const; virtual operator int32_t() const; --- oless/byteordr.hxx.orig 2013-09-09 13:51:09.321960046 +0200 +++ oless/byteordr.hxx 2013-09-09 13:52:42.402953979 +0200 @@ -66,6 +66,16 @@ *pw = ByteSwap(*pw); } +inline USHORT ByteSwap( USHORT u ) +{ + return( LOBYTE(u) << 8 | HIBYTE(u) ); +} + +inline VOID ByteSwap( USHORT *u ) +{ + *u = ByteSwap(*u); +} + // // DWORD Byte-Swap // --- oless/h/owchar.h.orig 2013-09-09 11:55:09.989439910 +0200 +++ oless/h/owchar.h 2013-09-09 12:17:20.942347923 +0200 @@ -32,7 +32,11 @@ #define _CRTAPI1 #endif +#if defined(HAVE_WCHAR_H) +typedef wchar_t WCHAR, *LPWSTR; +#else typedef uint16_t WCHAR, *LPWSTR; +#endif typedef const WCHAR* LPCWSTR; /* use an alias */