Commit 5910626a authored by Rob Shearman's avatar Rob Shearman Committed by Alexandre Julliard

oleaut32: Make the code in copy_to_variant and copy_from_variant more portable.

The typeof keyword isn't available on all compilers so avoid it if at all possible.
parent 86a4e99c
...@@ -59,7 +59,7 @@ static HRESULT copy_to_variant(void *src, VARIANT *pvar, enum VARENUM vt) ...@@ -59,7 +59,7 @@ static HRESULT copy_to_variant(void *src, VARIANT *pvar, enum VARENUM vt)
#define CASE_COPY(x) \ #define CASE_COPY(x) \
case VT_ ## x: \ case VT_ ## x: \
V_ ## x(pvar) = *(typeof(V_ ## x(pvar))*)src; \ memcpy(&V_ ## x(pvar), src, sizeof(V_ ## x(pvar))); \
break break
switch(vt) { switch(vt) {
...@@ -106,7 +106,7 @@ static HRESULT copy_from_variant(VARIANT *src, void *dest, enum VARENUM vt) ...@@ -106,7 +106,7 @@ static HRESULT copy_from_variant(VARIANT *src, void *dest, enum VARENUM vt)
#define CASE_COPY(x) \ #define CASE_COPY(x) \
case VT_ ## x: \ case VT_ ## x: \
*(typeof(V_ ## x(&var))*)dest = V_ ## x(&var); \ memcpy(dest, &V_ ## x(&var), sizeof(V_ ## x(&var))); \
break break
switch(vt) { switch(vt) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment