]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/utils.cpp
Fixed toolbar crash for MinGW/Cygwin
[wxWidgets.git] / src / msw / utils.cpp
index f53f41c260e2b83d9637a2a49a8f99d8c5665df0..d2b2ce1f501eb223a132b25e266fb1793a72af60 100644 (file)
@@ -498,14 +498,22 @@ bool wxGetDiskSpace(const wxString& path, wxLongLong *pTotal, wxLongLong *pFree)
             return FALSE;
         }
 
+        // ULARGE_INTEGER is a union of a 64 bit value and a struct containing
+        // two 32 bit fields which may be or may be not named - try to make it
+        // compile in all cases
+#if defined(__BORLANDC__) && !defined(_ANONYMOUS_STRUCT)
+        #define UL(ul) ul.u
+#else // anon union
+        #define UL(ul) ul
+#endif
         if ( pTotal )
         {
-            *pTotal = wxLongLong(bytesTotal.HighPart, bytesTotal.LowPart);
+            *pTotal = wxLongLong(UL(bytesTotal).HighPart, UL(bytesTotal).LowPart);
         }
 
         if ( pFree )
         {
-            *pFree = wxLongLong(bytesFree.HighPart, bytesFree.LowPart);
+            *pFree = wxLongLong(UL(bytesFree).HighPart, UL(bytesFree).LowPart);
         }
     }
     else