summaryrefslogtreecommitdiff
path: root/emulators/virtualbox-ose-70/files/patch-include_VBox_com_array.h
blob: 9d65058e6b50818b1ef964a852103f775ca7b9e0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
--- include/VBox/com/array.h.orig	2021-01-07 15:31:25 UTC
+++ include/VBox/com/array.h
@@ -171,7 +171,7 @@
 
 #include "VBox/com/defs.h"
 
-#if RT_GNUC_PREREQ(4, 6) || (defined(_MSC_VER) && (_MSC_VER >= 1600))
+#if RT_GNUC_PREREQ(4, 6) || (defined(_MSC_VER) && (_MSC_VER >= 1600)) || defined(_LIBCPP_VERSION)
 /** @def VBOX_WITH_TYPE_TRAITS
  * Type traits are a C++ 11 feature, so not available everywhere (yet).
  * Only GCC 4.6 or newer and MSVC++ 16.0 (Visual Studio 2010) or newer.
@@ -960,12 +960,12 @@ class SafeArray : public Traits (public)
     {
         /** @todo r=klaus should do this as a AssertCompile, but cannot find a way which works. */
         Assert(sizeof(T) <= sizeof(Zeroes));
-        AssertReturn(m.arr != NULL, *(T *)&Zeroes[0]);
-        AssertReturn(aIdx < size(), *(T *)&Zeroes[0]);
+        AssertReturn(m.arr != NULL,  *((T *)1));
+        AssertReturn(aIdx < size(), *((T *)1));
 #ifdef VBOX_WITH_XPCOM
         return m.arr[aIdx];
 #else
-        AssertReturn(m.raw != NULL, *(T *)&Zeroes[0]);
+        AssertReturn(m.raw != NULL,  *((T *)1));
         return m.raw[aIdx];
 #endif
     }
@@ -980,7 +980,7 @@ class SafeArray : public Traits (public)
 #ifdef VBOX_WITH_XPCOM
         return m.arr[aIdx];
 #else
-        AssertReturn(m.raw != NULL, *(const T *)&Zeroes[0]);
+         AssertReturn(m.raw != NULL,  *((T *)1));
         return m.raw[aIdx];
 #endif
     }