From 6bae4a8d925edd71640d22136798ef725b1cc612 Mon Sep 17 00:00:00 2001 From: Latif Khalifa Date: Sun, 20 Oct 2013 12:37:35 +0200 Subject: [PATCH] WIP: native win64 support --- indra/llcommon/llfasttimer_class.cpp | 2 +- indra/llcommon/llprocessor.cpp | 2 +- indra/llmath/llmath.h | 4 ++-- indra/llmath/llsimdmath.h | 2 +- indra/llwindow/llwindowwin32.cpp | 6 +++--- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/indra/llcommon/llfasttimer_class.cpp b/indra/llcommon/llfasttimer_class.cpp index 07ea31a5a..e753fe309 100644 --- a/indra/llcommon/llfasttimer_class.cpp +++ b/indra/llcommon/llfasttimer_class.cpp @@ -184,7 +184,7 @@ LLMutex* LLFastTimer::sLogLock = NULL; std::queue LLFastTimer::sLogQueue; const int LLFastTimer::NamedTimer::HISTORY_NUM = 300; -#if LL_WINDOWS +#if defined(LL_WINDOWS) && !defined(_WIN64) #define USE_RDTSC 1 #endif diff --git a/indra/llcommon/llprocessor.cpp b/indra/llcommon/llprocessor.cpp index ce2c593c5..a7d2eac67 100644 --- a/indra/llcommon/llprocessor.cpp +++ b/indra/llcommon/llprocessor.cpp @@ -416,7 +416,7 @@ static F64 calculate_cpu_frequency(U32 measure_msecs) unsigned long dwCurPriorityClass = GetPriorityClass(hProcess); int iCurThreadPriority = GetThreadPriority(hThread); unsigned long dwProcessMask, dwSystemMask, dwNewMask = 1; - GetProcessAffinityMask(hProcess, &dwProcessMask, &dwSystemMask); + GetProcessAffinityMask(hProcess, (PDWORD_PTR)&dwProcessMask, (PDWORD_PTR)&dwSystemMask); SetPriorityClass(hProcess, REALTIME_PRIORITY_CLASS); SetThreadPriority(hThread, THREAD_PRIORITY_TIME_CRITICAL); diff --git a/indra/llmath/llmath.h b/indra/llmath/llmath.h index 6d3f06710..274663643 100644 --- a/indra/llmath/llmath.h +++ b/indra/llmath/llmath.h @@ -140,7 +140,7 @@ inline F64 llabs(const F64 a) inline S32 lltrunc( F32 f ) { -#if LL_WINDOWS && !defined( __INTEL_COMPILER ) +#if LL_WINDOWS && !defined( __INTEL_COMPILER ) && !defined(_WIN64) // Avoids changing the floating point control word. // Add or subtract 0.5 - epsilon and then round const static U32 zpfp[] = { 0xBEFFFFFF, 0x3EFFFFFF }; @@ -166,7 +166,7 @@ inline S32 lltrunc( F64 f ) inline S32 llfloor( F32 f ) { -#if LL_WINDOWS && !defined( __INTEL_COMPILER ) +#if LL_WINDOWS && !defined( __INTEL_COMPILER ) && !defined(_WIN64) // Avoids changing the floating point control word. // Accurate (unlike Stereopsis version) for all values between S32_MIN and S32_MAX and slightly faster than Stereopsis version. // Add -(0.5 - epsilon) and then round diff --git a/indra/llmath/llsimdmath.h b/indra/llmath/llsimdmath.h index cebd2ace7..798795a8b 100644 --- a/indra/llmath/llsimdmath.h +++ b/indra/llmath/llsimdmath.h @@ -31,7 +31,7 @@ #error "Please include llmath.h before this file." #endif -#if ( ( LL_DARWIN || LL_LINUX ) && !(__SSE2__) ) || ( LL_WINDOWS && ( _M_IX86_FP < 2 ) ) +#if ( ( LL_DARWIN || LL_LINUX ) && !(__SSE2__) ) || ( LL_WINDOWS && ( _M_IX86_FP < 2 ) && !defined(_WIN64) ) #error SSE2 not enabled. LLVector4a and related class will not compile. #endif diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp index 78f54a7a4..807c547bd 100644 --- a/indra/llwindow/llwindowwin32.cpp +++ b/indra/llwindow/llwindowwin32.cpp @@ -749,7 +749,7 @@ void LLWindowWin32::close() LL_DEBUGS("Window") << "Destroying Window" << LL_ENDL; // Don't process events in our mainWindowProc any longer. - SetWindowLong(mWindowHandle, GWL_USERDATA, NULL); + SetWindowLongPtr(mWindowHandle, GWLP_USERDATA, NULL); // Make sure we don't leave a blank toolbar button. ShowWindow(mWindowHandle, SW_HIDE); @@ -1660,7 +1660,7 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO LL_DEBUGS("Window") << "Keeping vertical sync" << LL_ENDL; } - SetWindowLong(mWindowHandle, GWL_USERDATA, (U32)this); + SetWindowLongPtr(mWindowHandle, GWLP_USERDATA, (LONG_PTR)this); // register this window as handling drag/drop events from the OS DragAcceptFiles( mWindowHandle, TRUE ); @@ -1983,7 +1983,7 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_ // This helps prevent avatar walking after maximizing the window by double-clicking the title bar. static bool sHandleLeftMouseUp = true; - LLWindowWin32 *window_imp = (LLWindowWin32 *)GetWindowLong(h_wnd, GWL_USERDATA); + LLWindowWin32 *window_imp = (LLWindowWin32 *)GetWindowLongPtr(h_wnd, GWLP_USERDATA); if (NULL != window_imp)