Index: /trunk/include/VBox/com/array.h
===================================================================
--- /trunk/include/VBox/com/array.h	(revision 49575)
+++ /trunk/include/VBox/com/array.h	(revision 49576)
@@ -422,4 +422,16 @@
     }
 
+    /*
+     * Fallback method in case type traits (VBOX_WITH_TYPE_TRAITS)
+     * are not available. Always returns unsigned types.
+     */
+    static VARTYPE VarTypeUnsigned()
+    {
+        if (sizeof(T) % 8 == 0) return VT_UI8;
+        if (sizeof(T) % 4 == 0) return VT_UI4;
+        if (sizeof(T) % 2 == 0) return VT_UI2;
+        return VT_UI1;
+    }
+
     static ULONG VarCount(size_t aSize)
     {
@@ -650,8 +662,16 @@
             HRESULT rc = SafeArrayGetVartype(arg, &vt);
             AssertComRCReturnVoid(rc);
-            AssertMsgReturnVoid(vt == VarType(),
+# ifndef VBOX_WITH_TYPE_TRAITS
+            AssertMsgReturnVoid(
+                                   vt == VarType()
+                                || vt == VarTypeUnsigned(),
+                                ("Expected vartype %d or %d, got %d.\n",
+                                 VarType(), VarTypeUnsigned(), vt));
+# else /* !VBOX_WITH_TYPE_TRAITS */
+            AssertMsgReturnVoid(
+                                   vt == VarType(),
                                 ("Expected vartype %d, got %d.\n",
                                  VarType(), vt));
-
+# endif
             rc = SafeArrayAccessData(arg, (void HUGEP **)&m.raw);
             AssertComRCReturnVoid(rc);
@@ -1594,6 +1614,6 @@
             AssertComRCReturnVoid(rc);
             AssertMsgReturnVoid(vt == VT_UNKNOWN || vt == VT_DISPATCH,
-                                ("Expected vartype VT_UNKNOWN, got %d.\n",
-                                 VarType(), vt));
+                                ("Expected vartype VT_UNKNOWN or VT_DISPATCH, got %d.\n",
+                                 vt));
             GUID guid;
             rc = SafeArrayGetIID(arg, &guid);
