fix DECIMAL macros and enable DECIMAL processing functions

svn path=/trunk/; revision=8488
This commit is contained in:
Martin Fuchs 2004-02-29 16:24:54 +00:00
parent ed3857e1b1
commit 146314a91a
6 changed files with 49 additions and 145 deletions

View file

@ -172,11 +172,11 @@
174 stdcall VarNot(ptr ptr)
175 stub VarRound # stdcall (ptr long ptr)
176 stdcall VarCmp(ptr ptr long long)
#177 stdcall VarDecAdd(ptr ptr ptr)
177 stdcall VarDecAdd(ptr ptr ptr)
178 stdcall VarDecDiv(ptr ptr ptr)
#179 stdcall VarDecMul(ptr ptr ptr)
179 stdcall VarDecMul(ptr ptr ptr)
#180 stdcall CreateTypeLib2(long wstr ptr)
#181 stdcall VarDecSub(ptr ptr ptr)
181 stdcall VarDecSub(ptr ptr ptr)
182 stdcall VarDecAbs(ptr ptr)
#183 stdcall LoadTypeLibEx (wstr long ptr)
184 stdcall SystemTimeToVariantTime(ptr ptr)
@ -185,60 +185,60 @@
187 stdcall VarDecFix(ptr ptr)
188 stdcall VarDecInt(ptr ptr)
189 stdcall VarDecNeg(ptr ptr)
#190 stdcall VarDecFromUI1(long ptr)
#191 stdcall VarDecFromI2(long ptr)
#192 stdcall VarDecFromI4(long ptr)
190 stdcall VarDecFromUI1(long ptr)
191 stdcall VarDecFromI2(long ptr)
192 stdcall VarDecFromI4(long ptr)
193 stdcall VarDecFromR4(long ptr)
194 stdcall VarDecFromR8(double ptr)
195 stdcall VarDecFromDate(double ptr)
#196 stdcall VarDecFromCy(long long ptr)
196 stdcall VarDecFromCy(long long ptr)
197 stdcall VarDecFromStr(wstr long long ptr)
198 stdcall VarDecFromDisp(ptr long ptr)
#199 stdcall VarDecFromBool(long ptr)
199 stdcall VarDecFromBool(long ptr)
200 stdcall GetErrorInfo(long ptr) ole32.GetErrorInfo
201 stdcall SetErrorInfo(long ptr) ole32.SetErrorInfo
202 stdcall CreateErrorInfo(ptr) ole32.CreateErrorInfo
203 stdcall VarDecRound(ptr long ptr)
#204 stdcall VarDecCmp(ptr ptr)
204 stdcall VarDecCmp(ptr ptr)
205 stdcall VarI2FromI1(long ptr)
206 stdcall VarI2FromUI2(long ptr)
207 stdcall VarI2FromUI4(long ptr)
#208 stdcall VarI2FromDec(ptr ptr)
#209 stdcall VarI4FromI1(long ptr)
208 stdcall VarI2FromDec(ptr ptr)
209 stdcall VarI4FromI1(long ptr)
210 stdcall VarI4FromUI2(long ptr)
211 stdcall VarI4FromUI4(long ptr)
#212 stdcall VarI4FromDec(ptr ptr)
212 stdcall VarI4FromDec(ptr ptr)
213 stdcall VarR4FromI1(long ptr)
214 stdcall VarR4FromUI2(long ptr)
215 stdcall VarR4FromUI4(long ptr)
#216 stdcall VarR4FromDec(ptr ptr)
216 stdcall VarR4FromDec(ptr ptr)
217 stdcall VarR8FromI1(long ptr)
218 stdcall VarR8FromUI2(long ptr)
219 stdcall VarR8FromUI4(long ptr)
#220 stdcall VarR8FromDec(ptr ptr)
220 stdcall VarR8FromDec(ptr ptr)
221 stdcall VarDateFromI1(long ptr)
222 stdcall VarDateFromUI2(long ptr)
223 stdcall VarDateFromUI4(long ptr)
#224 stdcall VarDateFromDec(ptr ptr)
224 stdcall VarDateFromDec(ptr ptr)
225 stdcall VarCyFromI1(long ptr)
226 stdcall VarCyFromUI2(long ptr)
227 stdcall VarCyFromUI4(long ptr)
#228 stdcall VarCyFromDec(ptr ptr)
228 stdcall VarCyFromDec(ptr ptr)
229 stdcall VarBstrFromI1(long long long ptr)
230 stdcall VarBstrFromUI2(long long long ptr)
231 stdcall VarBstrFromUI4(long long long ptr)
#232 stdcall VarBstrFromDec(ptr long long ptr)
232 stdcall VarBstrFromDec(ptr long long ptr)
233 stdcall VarBoolFromI1(long ptr)
234 stdcall VarBoolFromUI2(long ptr)
235 stdcall VarBoolFromUI4(long ptr)
#236 stdcall VarBoolFromDec(ptr ptr)
236 stdcall VarBoolFromDec(ptr ptr)
237 stdcall VarUI1FromI1(long ptr)
238 stdcall VarUI1FromUI2(long ptr)
239 stdcall VarUI1FromUI4(long ptr)
#240 stdcall VarUI1FromDec(ptr ptr)
#241 stdcall VarDecFromI1(long ptr)
#242 stdcall VarDecFromUI2(long ptr)
#243 stdcall VarDecFromUI4(long ptr)
240 stdcall VarUI1FromDec(ptr ptr)
241 stdcall VarDecFromI1(long ptr)
242 stdcall VarDecFromUI2(long ptr)
243 stdcall VarDecFromUI4(long ptr)
244 stdcall VarI1FromUI1(long ptr)
245 stdcall VarI1FromI2(long ptr)
246 stdcall VarI1FromI4(long ptr)
@ -251,7 +251,7 @@
253 stdcall VarI1FromBool(long ptr)
254 stdcall VarI1FromUI2(long ptr)
255 stdcall VarI1FromUI4(long ptr)
#256 stdcall VarI1FromDec(ptr ptr)
256 stdcall VarI1FromDec(ptr ptr)
257 stdcall VarUI2FromUI1(long ptr)
258 stdcall VarUI2FromI2(long ptr)
259 stdcall VarUI2FromI4(long ptr)
@ -264,7 +264,7 @@
266 stdcall VarUI2FromBool(long ptr)
267 stdcall VarUI2FromI1(long ptr)
268 stdcall VarUI2FromUI4(long ptr)
#269 stdcall VarUI2FromDec(ptr ptr)
269 stdcall VarUI2FromDec(ptr ptr)
270 stdcall VarUI4FromUI1(long ptr)
271 stdcall VarUI4FromI2(long ptr)
272 stdcall VarUI4FromI4(long ptr)
@ -277,7 +277,7 @@
279 stdcall VarUI4FromBool(long ptr)
280 stdcall VarUI4FromI1(long ptr)
281 stdcall VarUI4FromUI2(long ptr)
#282 stdcall VarUI4FromDec(ptr ptr)
282 stdcall VarUI4FromDec(ptr ptr)
#283 stdcall BSTR_UserSize(ptr long ptr)
#284 stdcall BSTR_UserMarshal(ptr ptr ptr)
#285 stdcall BSTR_UserUnmarshal(ptr ptr ptr)
@ -293,7 +293,7 @@
295 stub LPSAFEARRAY_Size
296 stub LPSAFEARRAY_Marshal
297 stub LPSAFEARRAY_Unmarshal
#298 stdcall VarDecCmpR8(ptr double)
298 stdcall VarDecCmpR8(ptr double)
299 stdcall VarCyAdd(long long long long ptr)
303 stdcall VarCyMul(long long long long ptr)
304 stdcall VarCyMulI4(long long long ptr)
@ -335,7 +335,7 @@
342 stdcall VarI8FromI1(long long)
343 stdcall VarI8FromUI2(long long)
344 stdcall VarI8FromUI4(long long)
#345 stdcall VarI8FromDec(ptr ptr)
345 stdcall VarI8FromDec(ptr ptr)
346 stdcall VarI2FromI8(long long ptr)
347 stdcall VarI2FromUI8(long long ptr)
348 stdcall VarI4FromI8(long long ptr)
@ -354,8 +354,8 @@
371 stdcall VarBoolFromUI8(long long ptr)
372 stdcall VarUI1FromI8(long long ptr)
373 stdcall VarUI1FromUI8(long long ptr)
#374 stdcall VarDecFromI8(long long ptr)
#375 stdcall VarDecFromUI8(long long ptr)
374 stdcall VarDecFromI8(long long ptr)
375 stdcall VarDecFromUI8(long long ptr)
376 stdcall VarI1FromI8(long long ptr)
377 stdcall VarI1FromUI8(long long ptr)
378 stdcall VarUI2FromI8(long long ptr)
@ -413,4 +413,4 @@
438 stdcall VarUI8FromI1(long ptr)
439 stdcall VarUI8FromUI2(long ptr)
440 stdcall VarUI8FromUI4(long ptr)
#441 stdcall VarUI8FromDec(long ptr)
441 stdcall VarUI8FromDec(long ptr)

View file

@ -43,13 +43,6 @@
#include "variant.h"
#ifdef __REACTOS__ /*FIXME*/
/* problems with decVal member of VARIANT union in MinGW headers */
#undef V_DECIMAL
#define V_DECIMAL(X) (X->__VARIANT_NAME_1.decVal)
#endif
WINE_DEFAULT_DEBUG_CHANNEL(ole);
const char* wine_vtypes[VT_CLSID] =
@ -169,9 +162,7 @@ static inline HRESULT VARIANT_Coerce(VARIANTARG* pd, LCID lcid, USHORT wFlags,
case VT_DATE: return VarI1FromDate(V_DATE(ps), &V_I1(pd));
case VT_BOOL: return VarI1FromBool(V_BOOL(ps), &V_I1(pd));
case VT_CY: return VarI1FromCy(V_CY(ps), &V_I1(pd));
#ifndef __REACTOS__ /*FIXME: problems with MinGW and DEC_LO32 */
case VT_DECIMAL: return VarI1FromDec(&V_DECIMAL(ps), &V_I1(pd) );
#endif
case VT_DISPATCH: return VarI1FromDisp(V_DISPATCH(ps), lcid, &V_I1(pd) );
case VT_BSTR: return VarI1FromStr(V_BSTR(ps), lcid, dwFlags, &V_I1(pd) );
}
@ -193,9 +184,7 @@ static inline HRESULT VARIANT_Coerce(VARIANTARG* pd, LCID lcid, USHORT wFlags,
case VT_DATE: return VarI2FromDate(V_DATE(ps), &V_I2(pd));
case VT_BOOL: return VarI2FromBool(V_BOOL(ps), &V_I2(pd));
case VT_CY: return VarI2FromCy(V_CY(ps), &V_I2(pd));
#ifndef __REACTOS__ /*FIXME: problems with MinGW and DEC_LO32 */
case VT_DECIMAL: return VarI2FromDec(&V_DECIMAL(ps), &V_I2(pd));
#endif
case VT_DISPATCH: return VarI2FromDisp(V_DISPATCH(ps), lcid, &V_I2(pd));
case VT_BSTR: return VarI2FromStr(V_BSTR(ps), lcid, dwFlags, &V_I2(pd));
}
@ -217,9 +206,7 @@ static inline HRESULT VARIANT_Coerce(VARIANTARG* pd, LCID lcid, USHORT wFlags,
case VT_DATE: return VarI4FromDate(V_DATE(ps), &V_I4(pd));
case VT_BOOL: return VarI4FromBool(V_BOOL(ps), &V_I4(pd));
case VT_CY: return VarI4FromCy(V_CY(ps), &V_I4(pd));
#ifndef __REACTOS__ /*FIXME: problems with MinGW and DEC_LO32 */
case VT_DECIMAL: return VarI4FromDec(&V_DECIMAL(ps), &V_I4(pd));
#endif
case VT_DISPATCH: return VarI4FromDisp(V_DISPATCH(ps), lcid, &V_I4(pd));
case VT_BSTR: return VarI4FromStr(V_BSTR(ps), lcid, dwFlags, &V_I4(pd));
}
@ -241,9 +228,7 @@ static inline HRESULT VARIANT_Coerce(VARIANTARG* pd, LCID lcid, USHORT wFlags,
case VT_DATE: return VarUI1FromDate(V_DATE(ps), &V_UI1(pd));
case VT_BOOL: return VarUI1FromBool(V_BOOL(ps), &V_UI1(pd));
case VT_CY: return VarUI1FromCy(V_CY(ps), &V_UI1(pd));
#ifndef __REACTOS__ /*FIXME: problems with MinGW and DEC_LO32 */
case VT_DECIMAL: return VarUI1FromDec(&V_DECIMAL(ps), &V_UI1(pd));
#endif
case VT_DISPATCH: return VarUI1FromDisp(V_DISPATCH(ps), lcid, &V_UI1(pd));
case VT_BSTR: return VarUI1FromStr(V_BSTR(ps), lcid, dwFlags, &V_UI1(pd));
}
@ -265,9 +250,7 @@ static inline HRESULT VARIANT_Coerce(VARIANTARG* pd, LCID lcid, USHORT wFlags,
case VT_DATE: return VarUI2FromDate(V_DATE(ps), &V_UI2(pd));
case VT_BOOL: return VarUI2FromBool(V_BOOL(ps), &V_UI2(pd));
case VT_CY: return VarUI2FromCy(V_CY(ps), &V_UI2(pd));
#ifndef __REACTOS__ /*FIXME: problems with MinGW and DEC_LO32 */
case VT_DECIMAL: return VarUI2FromDec(&V_DECIMAL(ps), &V_UI2(pd));
#endif
case VT_DISPATCH: return VarUI2FromDisp(V_DISPATCH(ps), lcid, &V_UI2(pd));
case VT_BSTR: return VarUI2FromStr(V_BSTR(ps), lcid, dwFlags, &V_UI2(pd));
}
@ -289,9 +272,7 @@ static inline HRESULT VARIANT_Coerce(VARIANTARG* pd, LCID lcid, USHORT wFlags,
case VT_DATE: return VarUI4FromDate(V_DATE(ps), &V_UI4(pd));
case VT_BOOL: return VarUI4FromBool(V_BOOL(ps), &V_UI4(pd));
case VT_CY: return VarUI4FromCy(V_CY(ps), &V_UI4(pd));
#ifndef __REACTOS__ /*FIXME: problems with MinGW and DEC_LO32 */
case VT_DECIMAL: return VarUI4FromDec(&V_DECIMAL(ps), &V_UI4(pd));
#endif
case VT_DISPATCH: return VarUI4FromDisp(V_DISPATCH(ps), lcid, &V_UI4(pd));
case VT_BSTR: return VarUI4FromStr(V_BSTR(ps), lcid, dwFlags, &V_UI4(pd));
}
@ -313,9 +294,7 @@ static inline HRESULT VARIANT_Coerce(VARIANTARG* pd, LCID lcid, USHORT wFlags,
case VT_DATE: return VarUI8FromDate(V_DATE(ps), &V_UI8(pd));
case VT_BOOL: return VarUI8FromBool(V_BOOL(ps), &V_UI8(pd));
case VT_CY: return VarUI8FromCy(V_CY(ps), &V_UI8(pd));
#ifndef __REACTOS__ /*FIXME: problems with MinGW and DEC_LO32 */
case VT_DECIMAL: return VarUI8FromDec(&V_DECIMAL(ps), &V_UI8(pd));
#endif
case VT_DISPATCH: return VarUI8FromDisp(V_DISPATCH(ps), lcid, &V_UI8(pd));
case VT_BSTR: return VarUI8FromStr(V_BSTR(ps), lcid, dwFlags, &V_UI8(pd));
}
@ -337,9 +316,7 @@ static inline HRESULT VARIANT_Coerce(VARIANTARG* pd, LCID lcid, USHORT wFlags,
case VT_DATE: return VarI8FromDate(V_DATE(ps), &V_I8(pd));
case VT_BOOL: return VarI8FromBool(V_BOOL(ps), &V_I8(pd));
case VT_CY: return VarI8FromCy(V_CY(ps), &V_I8(pd));
#ifndef __REACTOS__ /*FIXME: problems with MinGW and DEC_LO32 */
case VT_DECIMAL: return VarI8FromDec(&V_DECIMAL(ps), &V_I8(pd));
#endif
case VT_DISPATCH: return VarI8FromDisp(V_DISPATCH(ps), lcid, &V_I8(pd));
case VT_BSTR: return VarI8FromStr(V_BSTR(ps), lcid, dwFlags, &V_I8(pd));
}
@ -361,9 +338,7 @@ static inline HRESULT VARIANT_Coerce(VARIANTARG* pd, LCID lcid, USHORT wFlags,
case VT_DATE: return VarR4FromDate(V_DATE(ps), &V_R4(pd));
case VT_BOOL: return VarR4FromBool(V_BOOL(ps), &V_R4(pd));
case VT_CY: return VarR4FromCy(V_CY(ps), &V_R4(pd));
#ifndef __REACTOS__ /*FIXME: problems with MinGW and DEC_LO32 */
case VT_DECIMAL: return VarR4FromDec(&V_DECIMAL(ps), &V_R4(pd));
#endif
case VT_DISPATCH: return VarR4FromDisp(V_DISPATCH(ps), lcid, &V_R4(pd));
case VT_BSTR: return VarR4FromStr(V_BSTR(ps), lcid, dwFlags, &V_R4(pd));
}
@ -385,9 +360,7 @@ static inline HRESULT VARIANT_Coerce(VARIANTARG* pd, LCID lcid, USHORT wFlags,
case VT_DATE: return VarR8FromDate(V_DATE(ps), &V_R8(pd));
case VT_BOOL: return VarR8FromBool(V_BOOL(ps), &V_R8(pd));
case VT_CY: return VarR8FromCy(V_CY(ps), &V_R8(pd));
#ifndef __REACTOS__ /*FIXME: problems with MinGW and DEC_LO32 */
case VT_DECIMAL: return VarR8FromDec(&V_DECIMAL(ps), &V_R8(pd));
#endif
case VT_DISPATCH: return VarR8FromDisp(V_DISPATCH(ps), lcid, &V_R8(pd));
case VT_BSTR: return VarR8FromStr(V_BSTR(ps), lcid, dwFlags, &V_R8(pd));
}
@ -409,9 +382,7 @@ static inline HRESULT VARIANT_Coerce(VARIANTARG* pd, LCID lcid, USHORT wFlags,
case VT_R8: return VarDateFromR8(V_R8(ps), &V_DATE(pd));
case VT_BOOL: return VarDateFromBool(V_BOOL(ps), &V_DATE(pd));
case VT_CY: return VarDateFromCy(V_CY(ps), &V_DATE(pd));
#ifndef __REACTOS__ /*FIXME: problems with MinGW and DEC_LO32 */
case VT_DECIMAL: return VarDateFromDec(&V_DECIMAL(ps), &V_DATE(pd));
#endif
case VT_DISPATCH: return VarDateFromDisp(V_DISPATCH(ps), lcid, &V_DATE(pd));
case VT_BSTR: return VarDateFromStr(V_BSTR(ps), lcid, dwFlags, &V_DATE(pd));
}
@ -433,9 +404,7 @@ static inline HRESULT VARIANT_Coerce(VARIANTARG* pd, LCID lcid, USHORT wFlags,
case VT_R8: return VarBoolFromR8(V_R8(ps), &V_BOOL(pd));
case VT_DATE: return VarBoolFromDate(V_DATE(ps), &V_BOOL(pd));
case VT_CY: return VarBoolFromCy(V_CY(ps), &V_BOOL(pd));
#ifndef __REACTOS__ /*FIXME: problems with MinGW and DEC_LO32 */
case VT_DECIMAL: return VarBoolFromDec(&V_DECIMAL(ps), &V_BOOL(pd));
#endif
case VT_DISPATCH: return VarBoolFromDisp(V_DISPATCH(ps), lcid, &V_BOOL(pd));
case VT_BSTR: return VarBoolFromStr(V_BSTR(ps), lcid, dwFlags, &V_BOOL(pd));
}
@ -463,9 +432,7 @@ static inline HRESULT VARIANT_Coerce(VARIANTARG* pd, LCID lcid, USHORT wFlags,
case VT_R8: return VarBstrFromR8(V_R8(ps), lcid, dwFlags, &V_BSTR(pd));
case VT_DATE: return VarBstrFromDate(V_DATE(ps), lcid, dwFlags, &V_BSTR(pd));
case VT_CY: return VarBstrFromCy(V_CY(ps), lcid, dwFlags, &V_BSTR(pd));
#ifndef __REACTOS__ /*FIXME: problems with MinGW and DEC_LO32 */
case VT_DECIMAL: return VarBstrFromDec(&V_DECIMAL(ps), lcid, dwFlags, &V_BSTR(pd));
#endif
/* case VT_DISPATCH: return VarBstrFromDisp(V_DISPATCH(ps), lcid, dwFlags, &V_BSTR(pd)); */
}
break;
@ -486,10 +453,8 @@ static inline HRESULT VARIANT_Coerce(VARIANTARG* pd, LCID lcid, USHORT wFlags,
case VT_R8: return VarCyFromR8(V_R8(ps), &V_CY(pd));
case VT_DATE: return VarCyFromDate(V_DATE(ps), &V_CY(pd));
case VT_BOOL: return VarCyFromBool(V_BOOL(ps), &V_CY(pd));
#ifndef __REACTOS__ /*FIXME: problems with MinGW and DEC_LO32 */
case VT_DECIMAL: return VarCyFromDec(&V_DECIMAL(ps), &V_CY(pd));
#endif
case VT_DISPATCH: return VarCyFromDisp(V_DISPATCH(ps), lcid, &V_CY(pd));
case VT_BSTR: return VarCyFromStr(V_BSTR(ps), lcid, dwFlags, &V_CY(pd));
}
@ -499,7 +464,6 @@ static inline HRESULT VARIANT_Coerce(VARIANTARG* pd, LCID lcid, USHORT wFlags,
switch (vtFrom)
{
case VT_EMPTY:
#ifndef __REACTOS__ /*FIXME: problems with MinGW and DEC_MID32 */
case VT_BOOL:
DEC_SIGNSCALE(&V_DECIMAL(pd)) = SIGNSCALE(DECIMAL_POS,0);
DEC_HI32(&V_DECIMAL(pd)) = 0;
@ -523,7 +487,6 @@ static inline HRESULT VARIANT_Coerce(VARIANTARG* pd, LCID lcid, USHORT wFlags,
case VT_CY: return VarDecFromCy(V_CY(pd), &V_DECIMAL(ps));
case VT_DISPATCH: return VarDecFromDisp(V_DISPATCH(ps), lcid, &V_DECIMAL(ps));
case VT_BSTR: return VarDecFromStr(V_BSTR(ps), lcid, dwFlags, &V_DECIMAL(pd));
#endif
}
break;
@ -640,14 +603,12 @@ HRESULT WINAPI VariantClear(VARIANTARG* pVarg)
{
if (!V_ISBYREF(pVarg))
{
#ifndef __REACTOS__ /*FIXME: no safearray yet */
if (V_ISARRAY(pVarg) || V_VT(pVarg) == VT_SAFEARRAY)
{
if (V_ARRAY(pVarg))
hres = SafeArrayDestroy(V_ARRAY(pVarg));
}
else
#endif
if (V_VT(pVarg) == VT_BSTR)
{
if (V_BSTR(pVarg))
@ -763,14 +724,12 @@ HRESULT WINAPI VariantCopy(VARIANTARG* pvargDest, VARIANTARG* pvargSrc)
if (!V_ISBYREF(pvargSrc))
{
#ifndef __REACTOS__ /*FIXME: no safearray yet */
if (V_ISARRAY(pvargSrc))
{
if (V_ARRAY(pvargSrc))
hres = SafeArrayCopy(V_ARRAY(pvargSrc), &V_ARRAY(pvargDest));
}
else
#endif
if (V_VT(pvargSrc) == VT_BSTR)
{
if (V_BSTR(pvargSrc))
@ -900,14 +859,12 @@ HRESULT WINAPI VariantCopyInd(VARIANT* pvargDest, VARIANTARG* pvargSrc)
}
}
#ifndef __REACTOS__ /*FIXME: no safearray yet */
if (V_ISARRAY(pSrc))
{
/* Native doesn't check that *V_ARRAYREF(pSrc) is valid */
hres = SafeArrayCopy(*V_ARRAYREF(pSrc), &V_ARRAY(pvargDest));
}
else
#endif
if (V_VT(pSrc) == (VT_BSTR|VT_BYREF))
{
/* Native doesn't check that *V_BSTRREF(pSrc) is valid */
@ -2083,7 +2040,6 @@ HRESULT WINAPI VarNumFromParseNum(NUMPARSE *pNumprs, BYTE *rgbDig,
V_I8(pVarDst) = -ul64;
return S_OK;
}
#ifndef __REACTOS__ /*FIXME: problems with MinGW and DEC_LO64 */
else if ((dwVtBits & REAL_VTBITS) == VTBIT_DECIMAL)
{
/* Decimal is only output choice left - fast path */
@ -2093,7 +2049,6 @@ HRESULT WINAPI VarNumFromParseNum(NUMPARSE *pNumprs, BYTE *rgbDig,
DEC_LO64(&V_DECIMAL(pVarDst)) = -ul64;
return S_OK;
}
#endif
}
}
else if (!bOverflow)
@ -2147,7 +2102,6 @@ HRESULT WINAPI VarNumFromParseNum(NUMPARSE *pNumprs, BYTE *rgbDig,
V_UI8(pVarDst) = ul64;
return S_OK;
}
#ifndef __REACTOS__ /*FIXME: problems with MinGW and DEC_LO64 */
else if ((dwVtBits & REAL_VTBITS) == VTBIT_DECIMAL)
{
/* Decimal is only output choice left - fast path */
@ -2157,7 +2111,6 @@ HRESULT WINAPI VarNumFromParseNum(NUMPARSE *pNumprs, BYTE *rgbDig,
DEC_LO64(&V_DECIMAL(pVarDst)) = ul64;
return S_OK;
}
#endif
}
}
@ -2252,7 +2205,6 @@ HRESULT WINAPI VarNumFromParseNum(NUMPARSE *pNumprs, BYTE *rgbDig,
}
}
#ifndef __REACTOS__ /*FIXME: problems with MinGW and DEC_LO64 */
if (dwVtBits & VTBIT_DECIMAL)
{
int i;
@ -2310,7 +2262,6 @@ VarNumFromParseNum_DecOverflow:
V_VT(pVarDst) = VT_DECIMAL;
return S_OK;
}
#endif
return DISP_E_OVERFLOW; /* No more output choices */
}
@ -3443,7 +3394,6 @@ HRESULT WINAPI VarNot(LPVARIANT pVarIn, LPVARIANT pVarOut)
case VT_BOOL:
case VT_I2: V_I2(pVarOut) = ~V_I2(pVarIn); break;
case VT_UI2: V_UI2(pVarOut) = ~V_UI2(pVarIn); break;
#ifndef __REACTOS__ /*FIXME: problems with MinGW and DEC_LO32 */
case VT_DECIMAL:
hRet = VarI4FromDec(&V_DECIMAL(pVarIn), &V_I4(&varIn));
if (FAILED(hRet))
@ -3451,7 +3401,6 @@ HRESULT WINAPI VarNot(LPVARIANT pVarIn, LPVARIANT pVarOut)
pVarIn = &varIn;
V_VT(pVarOut) = VT_I4;
/* Fall through ... */
#endif
case VT_INT:
case VT_I4: V_I4(pVarOut) = ~V_I4(pVarIn); break;
case VT_UINT:

View file

@ -82,13 +82,15 @@ extern const char* wine_vflags[];
#endif
/* Macros for getting at a DECIMAL's parts */
#ifndef DEC_LO64
#define DEC_SIGN(d) ((d)->u.s.sign)
#define DEC_SCALE(d) ((d)->u.s.scale)
#define DEC_SIGNSCALE(d) ((d)->u.signscale)
#define DEC_HI32(d) ((d)->Hi32)
#define DEC_MID32(d) ((d)->u1.s1.Mid32)
#define DEC_LO32(d) ((d)->u1.s1.Lo32)
#define DEC_LO64(d) ((d)->u1.Lo64)
#define DEC_MID32(d) ((d)->DUMMYUNIONNAME2.DUMMYSTRUCTNAME2.Mid32)
#define DEC_LO32(d) ((d)->DUMMYUNIONNAME2.DUMMYSTRUCTNAME2.Lo32)
#define DEC_LO64(d) ((d)->DUMMYUNIONNAME2.Lo64)
#endif
#define DEC_MAX_SCALE 28 /* Maximum scale for a decimal */

View file

@ -30,13 +30,6 @@
WINE_DEFAULT_DEBUG_CHANNEL(ole);
#ifdef __REACTOS__ /*FIXME*/
/* problems with decVal member of VARIANT union in MinGW headers */
#undef V_DECIMAL
#define V_DECIMAL(X) (X->__VARIANT_NAME_1.decVal)
#endif
extern HMODULE OLEAUT32_hModule;
static const WCHAR szFloatFormatW[] = { '%','.','7','G','\0' };
@ -388,7 +381,6 @@ HRESULT WINAPI VarI1FromUI4(ULONG ulIn, signed char* pcOut)
* Failure: E_INVALIDARG, if the source value is invalid
* DISP_E_OVERFLOW, if the value will not fit in the destination
*/
#ifndef __REACTOS__ /*FIXME: problems with MinGW and DEC_MID32 */
HRESULT WINAPI VarI1FromDec(DECIMAL *pdecIn, signed char* pcOut)
{
LONG64 i64;
@ -400,7 +392,6 @@ HRESULT WINAPI VarI1FromDec(DECIMAL *pdecIn, signed char* pcOut)
hRet = _VarI1FromI8(i64, pcOut);
return hRet;
}
#endif
/************************************************************************
* VarI1FromI8 (OLEAUT32.376)
@ -701,7 +692,6 @@ HRESULT WINAPI VarUI1FromUI4(ULONG ulIn, BYTE* pbOut)
* Failure: E_INVALIDARG, if the source value is invalid
* DISP_E_OVERFLOW, if the value will not fit in the destination
*/
#ifndef __REACTOS__ /*FIXME: problems with MinGW and DEC_MID32 */
HRESULT WINAPI VarUI1FromDec(DECIMAL *pdecIn, BYTE* pbOut)
{
LONG64 i64;
@ -713,7 +703,6 @@ HRESULT WINAPI VarUI1FromDec(DECIMAL *pdecIn, BYTE* pbOut)
hRet = _VarUI1FromI8(i64, pbOut);
return hRet;
}
#endif
/************************************************************************
* VarUI1FromI8 (OLEAUT32.372)
@ -1000,7 +989,6 @@ HRESULT WINAPI VarI2FromUI4(ULONG ulIn, SHORT* psOut)
* Failure: E_INVALIDARG, if the source value is invalid
* DISP_E_OVERFLOW, if the value will not fit in the destination
*/
#ifndef __REACTOS__ /*FIXME: problems with MinGW and DEC_LO64 */
HRESULT WINAPI VarI2FromDec(DECIMAL *pdecIn, SHORT* psOut)
{
LONG64 i64;
@ -1012,7 +1000,6 @@ HRESULT WINAPI VarI2FromDec(DECIMAL *pdecIn, SHORT* psOut)
hRet = _VarI2FromI8(i64, psOut);
return hRet;
}
#endif
/************************************************************************
* VarI2FromI8 (OLEAUT32.346)
@ -1299,7 +1286,6 @@ HRESULT WINAPI VarUI2FromUI4(ULONG ulIn, USHORT* pusOut)
* Failure: E_INVALIDARG, if the source value is invalid
* DISP_E_OVERFLOW, if the value will not fit in the destination
*/
#ifndef __REACTOS__ /*FIXME: problems with MinGW and DEC_MID32 */
HRESULT WINAPI VarUI2FromDec(DECIMAL *pdecIn, USHORT* pusOut)
{
LONG64 i64;
@ -1311,7 +1297,6 @@ HRESULT WINAPI VarUI2FromDec(DECIMAL *pdecIn, USHORT* pusOut)
hRet = _VarUI2FromI8(i64, pusOut);
return hRet;
}
#endif
/************************************************************************
* VarUI2FromI8 (OLEAUT32.378)
@ -1593,7 +1578,6 @@ HRESULT WINAPI VarI4FromUI4(ULONG ulIn, LONG *piOut)
* Failure: E_INVALIDARG, if pdecIn is invalid
* DISP_E_OVERFLOW, if the value will not fit in the destination
*/
#ifndef __REACTOS__ /*FIXME: problems with MinGW and DEC_MID32 */
HRESULT WINAPI VarI4FromDec(DECIMAL *pdecIn, LONG *piOut)
{
LONG64 i64;
@ -1605,7 +1589,6 @@ HRESULT WINAPI VarI4FromDec(DECIMAL *pdecIn, LONG *piOut)
hRet = _VarI4FromI8(i64, piOut);
return hRet;
}
#endif
/************************************************************************
* VarI4FromI8 (OLEAUT32.348)
@ -1888,7 +1871,6 @@ HRESULT WINAPI VarUI4FromUI2(USHORT usIn, ULONG *pulOut)
* Failure: E_INVALIDARG, if pdecIn is invalid
* DISP_E_OVERFLOW, if the value will not fit in the destination
*/
#ifndef __REACTOS__ /*FIXME: problems with MinGW and DEC_MID32 */
HRESULT WINAPI VarUI4FromDec(DECIMAL *pdecIn, ULONG *pulOut)
{
LONG64 i64;
@ -1900,7 +1882,6 @@ HRESULT WINAPI VarUI4FromDec(DECIMAL *pdecIn, ULONG *pulOut)
hRet = _VarUI4FromI8(i64, pulOut);
return hRet;
}
#endif
/************************************************************************
* VarUI4FromI8 (OLEAUT32.425)
@ -2214,7 +2195,6 @@ HRESULT WINAPI VarI8FromUI4(ULONG ulIn, LONG64* pi64Out)
* Failure: E_INVALIDARG, if the source value is invalid
* DISP_E_OVERFLOW, if the value will not fit in the destination
*/
#ifndef __REACTOS__ /*FIXME: problems with MinGW and DEC_MID32 */
HRESULT WINAPI VarI8FromDec(DECIMAL *pdecIn, LONG64* pi64Out)
{
if (!DEC_SCALE(pdecIn))
@ -2244,7 +2224,6 @@ HRESULT WINAPI VarI8FromDec(DECIMAL *pdecIn, LONG64* pi64Out)
return hRet;
}
}
#endif
/************************************************************************
* VarI8FromUI8 (OLEAUT32.427)
@ -2551,7 +2530,6 @@ HRESULT WINAPI VarUI8FromUI4(ULONG ulIn, ULONG64* pui64Out)
* with DISP_E_OVERFLOW. This bug has been fixed in Wine's implementation
* (use VarAbs() on pDecIn first if you really want this behaviour).
*/
#ifndef __REACTOS__ /*FIXME: problems with MinGW and DEC_LO64 */
HRESULT WINAPI VarUI8FromDec(DECIMAL *pdecIn, ULONG64* pui64Out)
{
if (!DEC_SCALE(pdecIn))
@ -2584,7 +2562,6 @@ HRESULT WINAPI VarUI8FromDec(DECIMAL *pdecIn, ULONG64* pui64Out)
return hRet;
}
}
#endif
/* R4
*/
@ -2825,7 +2802,6 @@ HRESULT WINAPI VarR4FromUI4(ULONG ulIn, float *pFltOut)
* Success: S_OK.
* Failure: E_INVALIDARG, if the source value is invalid.
*/
#ifndef __REACTOS__ /*FIXME: problems with MinGW and DEC_LO64 */
HRESULT WINAPI VarR4FromDec(DECIMAL* pDecIn, float *pFltOut)
{
BYTE scale = DEC_SCALE(pDecIn);
@ -2852,7 +2828,6 @@ HRESULT WINAPI VarR4FromDec(DECIMAL* pDecIn, float *pFltOut)
*pFltOut = (double)DEC_LO64(pDecIn) / (double)divisor + highPart;
return S_OK;
}
#endif
/************************************************************************
@ -3148,7 +3123,6 @@ HRESULT WINAPI VarR8FromUI4(ULONG ulIn, double *pDblOut)
* Success: S_OK.
* Failure: E_INVALIDARG, if the source value is invalid.
*/
#ifndef __REACTOS__ /*FIXME: problems with MinGW and DEC_LO64 */
HRESULT WINAPI VarR8FromDec(DECIMAL* pDecIn, double *pDblOut)
{
BYTE scale = DEC_SCALE(pDecIn);
@ -3174,7 +3148,6 @@ HRESULT WINAPI VarR8FromDec(DECIMAL* pDecIn, double *pDblOut)
*pDblOut = (double)DEC_LO64(pDecIn) / divisor + highPart;
return S_OK;
}
#endif
/************************************************************************
* VarR8FromI8 (OLEAUT32.362)
@ -3581,7 +3554,6 @@ HRESULT WINAPI VarCyFromUI4(ULONG ulIn, CY* pCyOut)
* DISP_E_OVERFLOW, if the value will not fit in the destination
* DISP_E_TYPEMISMATCH, if the type cannot be converted
*/
#ifndef __REACTOS__ /*FIXME: problems with MinGW and DEC_LO64 */
HRESULT WINAPI VarCyFromDec(DECIMAL* pdecIn, CY* pCyOut)
{
DECIMAL rounded;
@ -3604,7 +3576,6 @@ HRESULT WINAPI VarCyFromDec(DECIMAL* pdecIn, CY* pCyOut)
}
return hRet;
}
#endif
/************************************************************************
* VarCyFromI8 (OLEAUT32.366)
@ -3972,7 +3943,6 @@ HRESULT WINAPI VarCyMulI8(const CY cyLeft, LONG64 llRight, CY* pCyOut)
* RETURNS
* S_OK.
*/
#ifndef __REACTOS__ /*FIXME: problems with MinGW and DEC_LO64 */
HRESULT WINAPI VarDecFromUI1(BYTE bIn, DECIMAL* pDecOut)
{
return _VarDecFromUI1(bIn, pDecOut);
@ -3994,7 +3964,6 @@ HRESULT WINAPI VarDecFromI2(SHORT sIn, DECIMAL* pDecOut)
{
return _VarDecFromI2(sIn, pDecOut);
}
#endif
/************************************************************************
* VarDecFromI4 (OLEAUT32.192)
@ -4008,7 +3977,6 @@ HRESULT WINAPI VarDecFromI2(SHORT sIn, DECIMAL* pDecOut)
* RETURNS
* S_OK.
*/
#ifndef __REACTOS__ /*FIXME: problems with MinGW and DEC_MID32 */
HRESULT WINAPI VarDecFromI4(LONG lIn, DECIMAL* pDecOut)
{
DEC_HI32(pDecOut) = 0;
@ -4026,7 +3994,6 @@ HRESULT WINAPI VarDecFromI4(LONG lIn, DECIMAL* pDecOut)
}
return S_OK;
}
#endif
/************************************************************************
* VarDecFromR4 (OLEAUT32.193)
@ -4097,7 +4064,6 @@ HRESULT WINAPI VarDecFromDate(DATE dateIn, DECIMAL* pDecOut)
* RETURNS
* S_OK.
*/
#ifndef __REACTOS__ /*FIXME: problems with MinGW and DEC_LO64 */
HRESULT WINAPI VarDecFromCy(CY cyIn, DECIMAL* pDecOut)
{
DEC_HI32(pDecOut) = 0;
@ -4116,7 +4082,6 @@ HRESULT WINAPI VarDecFromCy(CY cyIn, DECIMAL* pDecOut)
}
return S_OK;
}
#endif
/************************************************************************
@ -4173,7 +4138,6 @@ HRESULT WINAPI VarDecFromDisp(IDispatch* pdispIn, LCID lcid, DECIMAL* pDecOut)
* NOTES
* The value is converted to either 0 (if bIn is FALSE) or -1 (TRUE).
*/
#ifndef __REACTOS__ /*FIXME: problems with MinGW and DEC_MID32 */
HRESULT WINAPI VarDecFromBool(VARIANT_BOOL bIn, DECIMAL* pDecOut)
{
DEC_HI32(pDecOut) = 0;
@ -4224,7 +4188,6 @@ HRESULT WINAPI VarDecFromUI2(USHORT usIn, DECIMAL* pDecOut)
{
return _VarDecFromUI2(usIn, pDecOut);
}
#endif
/************************************************************************
* VarDecFromUI4 (OLEAUT32.243)
@ -4238,7 +4201,6 @@ HRESULT WINAPI VarDecFromUI2(USHORT usIn, DECIMAL* pDecOut)
* RETURNS
* S_OK.
*/
#ifndef __REACTOS__ /*FIXME: problems with MinGW and DEC_MID32 */
HRESULT WINAPI VarDecFromUI4(ULONG ulIn, DECIMAL* pDecOut)
{
DEC_SIGNSCALE(pDecOut) = SIGNSCALE(DECIMAL_POS,0);
@ -4247,7 +4209,6 @@ HRESULT WINAPI VarDecFromUI4(ULONG ulIn, DECIMAL* pDecOut)
DEC_LO32(pDecOut) = ulIn;
return S_OK;
}
#endif
/************************************************************************
* VarDecFromI8 (OLEAUT32.374)
@ -4261,7 +4222,6 @@ HRESULT WINAPI VarDecFromUI4(ULONG ulIn, DECIMAL* pDecOut)
* RETURNS
* S_OK.
*/
#ifndef __REACTOS__ /*FIXME: problems with MinGW and DEC_LO64 */
HRESULT WINAPI VarDecFromI8(LONG64 llIn, DECIMAL* pDecOut)
{
PULARGE_INTEGER pLi = (PULARGE_INTEGER)&llIn;
@ -4282,7 +4242,6 @@ HRESULT WINAPI VarDecFromI8(LONG64 llIn, DECIMAL* pDecOut)
}
return S_OK;
}
#endif
/************************************************************************
* VarDecFromUI8 (OLEAUT32.375)
@ -4296,7 +4255,6 @@ HRESULT WINAPI VarDecFromI8(LONG64 llIn, DECIMAL* pDecOut)
* RETURNS
* S_OK.
*/
#ifndef __REACTOS__ /*FIXME: problems with MinGW and DEC_LO64 */
HRESULT WINAPI VarDecFromUI8(ULONG64 ullIn, DECIMAL* pDecOut)
{
DEC_SIGNSCALE(pDecOut) = SIGNSCALE(DECIMAL_POS,0);
@ -4304,9 +4262,7 @@ HRESULT WINAPI VarDecFromUI8(ULONG64 ullIn, DECIMAL* pDecOut)
DEC_LO64(pDecOut) = ullIn;
return S_OK;
}
#endif
#ifndef __REACTOS__ /*FIXME: problems with MinGW and DEC_LO32 */
/* Make two DECIMALS the same scale; used by math functions below */
static HRESULT VARIANT_DecScale(const DECIMAL** ppDecLeft,
const DECIMAL** ppDecRight,
@ -4352,7 +4308,6 @@ static HRESULT VARIANT_DecScale(const DECIMAL** ppDecLeft,
DEC_SCALE(pDecOut) += scaleAmount; /* Set the new scale */
return hRet;
}
#endif
/* Add two unsigned 32 bit values with overflow */
static ULONG VARIANT_Add(ULONG ulLeft, ULONG ulRight, ULONG* pulHigh)
@ -4398,7 +4353,6 @@ static ULONG VARIANT_Mul(ULONG ulLeft, ULONG ulRight, ULONG* pulHigh)
return ul64.u.LowPart;
}
#ifndef __REACTOS__ /*FIXME: problems with MinGW and DEC_LO64 */
/* Compare two decimals that have the same scale */
static inline int VARIANT_DecCmp(const DECIMAL *pDecLeft, const DECIMAL *pDecRight)
{
@ -4409,7 +4363,6 @@ static inline int VARIANT_DecCmp(const DECIMAL *pDecLeft, const DECIMAL *pDecRig
return 0;
return 1;
}
#endif
/************************************************************************
* VarDecAdd (OLEAUT32.177)
@ -4425,7 +4378,6 @@ static inline int VARIANT_DecCmp(const DECIMAL *pDecLeft, const DECIMAL *pDecRig
* Success: S_OK.
* Failure: DISP_E_OVERFLOW, if the value will not fit in the destination
*/
#ifndef __REACTOS__ /*FIXME: problems with MinGW and DEC_LO32 */
HRESULT WINAPI VarDecAdd(const DECIMAL* pDecLeft, const DECIMAL* pDecRight, DECIMAL* pDecOut)
{
HRESULT hRet;
@ -4496,7 +4448,6 @@ VarDecAdd_AsPositive:
}
return hRet;
}
#endif
/************************************************************************
* VarDecDiv (OLEAUT32.178)
@ -4532,7 +4483,6 @@ HRESULT WINAPI VarDecDiv(const DECIMAL* pDecLeft, const DECIMAL* pDecRight, DECI
* Success: S_OK.
* Failure: DISP_E_OVERFLOW, if the value will not fit in the destination
*/
#ifndef __REACTOS__ /*FIXME: problems with MinGW and DEC_LO32 */
HRESULT WINAPI VarDecMul(const DECIMAL* pDecLeft, const DECIMAL* pDecRight, DECIMAL* pDecOut)
{
/* FIXME: This only allows multiplying by a fixed integer <= 0xffffffff */
@ -4594,7 +4544,6 @@ HRESULT WINAPI VarDecSub(const DECIMAL* pDecLeft, const DECIMAL* pDecRight, DECI
VarDecNeg(pDecRight, &decRight);
return VarDecAdd(pDecLeft, &decRight, pDecOut);
}
#endif
/************************************************************************
* VarDecAbs (OLEAUT32.182)
@ -4739,7 +4688,6 @@ HRESULT WINAPI VarDecRound(const DECIMAL* pDecIn, int cDecimals, DECIMAL* pDecOu
* is less than, equal to or greater than pDecRight respectively.
* Failure: DISP_E_OVERFLOW, if overflow occurs during the comparason
*/
#ifndef __REACTOS__ /*FIXME: problems with MinGW and DEC_LO32 */
HRESULT WINAPI VarDecCmp(const DECIMAL* pDecLeft, const DECIMAL* pDecRight)
{
HRESULT hRet;
@ -4789,7 +4737,6 @@ HRESULT WINAPI VarDecCmpR8(const DECIMAL* pDecLeft, double dblRight)
return hRet;
}
#endif
/* BOOL
*/
@ -5129,7 +5076,6 @@ HRESULT WINAPI VarBoolFromUI4(ULONG ulIn, VARIANT_BOOL *pBoolOut)
* Success: S_OK.
* Failure: E_INVALIDARG, if pDecIn is invalid.
*/
#ifndef __REACTOS__ /*FIXME: problems with MinGW and DEC_LO32 */
HRESULT WINAPI VarBoolFromDec(DECIMAL* pDecIn, VARIANT_BOOL *pBoolOut)
{
if (DEC_SCALE(pDecIn) > DEC_MAX_SCALE || (DEC_SIGN(pDecIn) & ~DECIMAL_NEG))
@ -5141,7 +5087,6 @@ HRESULT WINAPI VarBoolFromDec(DECIMAL* pDecIn, VARIANT_BOOL *pBoolOut)
*pBoolOut = VARIANT_FALSE;
return S_OK;
}
#endif
/************************************************************************
* VarBoolFromI8 (OLEAUT32.370)
@ -5650,7 +5595,6 @@ HRESULT WINAPI VarBstrFromUI4(ULONG ulIn, LCID lcid, ULONG dwFlags, BSTR* pbstrO
* Failure: E_INVALIDARG, if pbstrOut is invalid.
* E_OUTOFMEMORY, if memory allocation fails.
*/
#ifndef __REACTOS__ /*FIXME: problems with MinGW and DEC_LO64 */
HRESULT WINAPI VarBstrFromDec(DECIMAL* pDecIn, LCID lcid, ULONG dwFlags, BSTR* pbstrOut)
{
if (!pbstrOut)
@ -5673,7 +5617,6 @@ HRESULT WINAPI VarBstrFromDec(DECIMAL* pDecIn, LCID lcid, ULONG dwFlags, BSTR* p
FIXME("semi-stub\n");
return E_INVALIDARG;
}
#endif
/************************************************************************
* VarBstrFromI8 (OLEAUT32.370)
@ -6578,12 +6521,10 @@ HRESULT WINAPI VarDateFromUI4(ULONG ulIn, DATE* pdateOut)
* RETURNS
* S_OK.
*/
#ifndef __REACTOS__ /*FIXME: problems with MinGW and DEC_MID32 */
HRESULT WINAPI VarDateFromDec(DECIMAL *pdecIn, DATE* pdateOut)
{
return _VarDateFromDec(pdecIn, pdateOut);
}
#endif
/******************************************************************************
* VarDateFromI8 (OLEAUT32.364)

View file

@ -89,7 +89,11 @@
#define V_ARRAY(X) V_UNION(X,parray)
#define V_ARRAYREF(X) V_UNION(X,pparray)
#define V_BYREF(X) V_UNION(X,byref)
#define V_DECIMAL(X) V_UNION(X,decVal)
#if (__STDC__ && !defined(_FORCENAMELESSUNION)) || defined(NONAMELESSUNION)
#define V_DECIMAL(X) ((X)->n1.decVal)
#else
#define V_DECIMAL(X) ((X)->decVal)
#endif
#define V_DECIMALREF(X) V_UNION(X,pdecVal)
#define V_I1(X) V_UNION(X,cVal)
#ifdef _WIN64

View file

@ -11,11 +11,19 @@
extern "C" {
#endif
#define DEC_SIGN(d) ((d)->u.s.sign)
#define DEC_SCALE(d) ((d)->u.s.scale)
#define DEC_SIGNSCALE(d) ((d)->u.signscale)
#define DEC_HI32(d) ((d)->Hi32)
#define DEC_MID32(d) ((d)->DUMMYUNIONNAME2.DUMMYSTRUCTNAME2.Mid32)
#define DEC_LO32(d) ((d)->DUMMYUNIONNAME2.DUMMYSTRUCTNAME2.Lo32)
#define DEC_LO64(d) ((d)->DUMMYUNIONNAME2.Lo64)
#define IID_NULL GUID_NULL
#define CLSID_NULL GUID_NULL
#define CBPCLIPDATA(d) ((d).cbSize-sizeof((d).ulClipFmt))
#define DECIMAL_NEG ((BYTE)0x80)
#define DECIMAL_SETZERO(d) {(d).Lo64=(d).Hi32=(d).signscale=0;}
#define DECIMAL_SETZERO(d) {DEC_LO64(d)=DEC_HI32(d)=DEC_SIGNSCALE(d)=0;}
#define ROTFLAGS_REGISTRATIONKEEPSALIVE 0x01
#define ROTFLAGS_ALLOWANYCLIENT 0x02