From 221e1181e82ea26a3ed66d39adad45209b18347d Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 6 Feb 2002 14:04:54 +0000 Subject: [PATCH 1/1] compilation fix for BC++ (hopefully) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@14028 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/utils.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/msw/utils.cpp b/src/msw/utils.cpp index f53f41c260..d2b2ce1f50 100644 --- a/src/msw/utils.cpp +++ b/src/msw/utils.cpp @@ -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 -- 2.45.2