Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJürgen Herrmann <shadowrom@me.com>2013-05-14 00:27:05 +0400
committerJürgen Herrmann <shadowrom@me.com>2013-05-14 00:27:05 +0400
commit3d3a4e8eec2a1549fd8b0ec32e6ddd73af5938d5 (patch)
treef392e410dae7c51c13cecbccecd918f17439e8db
parent92da9792fe7f3d2b67f59133c584786aa72777ae (diff)
Patch [#35234]:
Fix GetWindowsLon and SetWindowsLong issues with VS2012 and Windows 8. Remove unneeded #ifdef block for GWL_WNDPROC and GWL_USERDATA
-rw-r--r--intern/ghost/intern/GHOST_SystemWin32.cpp10
-rw-r--r--intern/ghost/intern/GHOST_WindowWin32.cpp10
-rw-r--r--source/gameengine/GamePlayer/ghost/GPG_Application.cpp6
3 files changed, 5 insertions, 21 deletions
diff --git a/intern/ghost/intern/GHOST_SystemWin32.cpp b/intern/ghost/intern/GHOST_SystemWin32.cpp
index c51ddbed176..9ad89667e76 100644
--- a/intern/ghost/intern/GHOST_SystemWin32.cpp
+++ b/intern/ghost/intern/GHOST_SystemWin32.cpp
@@ -47,14 +47,6 @@
#include <shlobj.h>
#include <tlhelp32.h>
-// win64 doesn't define GWL_USERDATA
-#ifdef WIN32
-# ifndef GWL_USERDATA
-# define GWL_USERDATA GWLP_USERDATA
-# define GWL_WNDPROC GWLP_WNDPROC
-# endif
-#endif
-
#include "utfconv.h"
#include "GHOST_DisplayManagerWin32.h"
@@ -904,7 +896,7 @@ LRESULT WINAPI GHOST_SystemWin32::s_wndProc(HWND hwnd, UINT msg, WPARAM wParam,
GHOST_ASSERT(system, "GHOST_SystemWin32::s_wndProc(): system not initialized");
if (hwnd) {
- GHOST_WindowWin32 *window = (GHOST_WindowWin32 *)::GetWindowLongPtr(hwnd, GWL_USERDATA);
+ GHOST_WindowWin32 *window = (GHOST_WindowWin32 *)::GetWindowLongPtr(hwnd, GWLP_USERDATA);
if (window) {
switch (msg) {
// we need to check if new key layout has AltGr
diff --git a/intern/ghost/intern/GHOST_WindowWin32.cpp b/intern/ghost/intern/GHOST_WindowWin32.cpp
index e5e734e4e57..3871ececee8 100644
--- a/intern/ghost/intern/GHOST_WindowWin32.cpp
+++ b/intern/ghost/intern/GHOST_WindowWin32.cpp
@@ -50,14 +50,6 @@
#define WGL_SAMPLE_BUFFERS_ARB 0x2041
#define WGL_SAMPLES_ARB 0x2042
-// win64 doesn't define GWL_USERDATA
-#ifdef WIN32 /* why? - probably should remove */
-# ifndef GWL_USERDATA
-# define GWL_USERDATA GWLP_USERDATA
-# define GWL_WNDPROC GWLP_WNDPROC
-# endif
-#endif
-
const wchar_t *GHOST_WindowWin32::s_windowClassName = L"GHOST_WindowClass";
const int GHOST_WindowWin32::s_maxTitleLength = 128;
HGLRC GHOST_WindowWin32::s_firsthGLRc = NULL;
@@ -270,7 +262,7 @@ GHOST_WindowWin32::GHOST_WindowWin32(
}
// Store a pointer to this class in the window structure
- ::SetWindowLongPtr(m_hWnd, GWL_USERDATA, (LONG_PTR) this);
+ ::SetWindowLongPtr(m_hWnd, GWLP_USERDATA, (LONG_PTR) this);
m_wsh.setHWND(m_hWnd);
m_wsh.setMinSize(320, 240);
diff --git a/source/gameengine/GamePlayer/ghost/GPG_Application.cpp b/source/gameengine/GamePlayer/ghost/GPG_Application.cpp
index 31ce1869544..3cba65779d1 100644
--- a/source/gameengine/GamePlayer/ghost/GPG_Application.cpp
+++ b/source/gameengine/GamePlayer/ghost/GPG_Application.cpp
@@ -260,14 +260,14 @@ bool GPG_Application::startScreenSaverPreview(
}
SetParent(ghost_hwnd, parentWindow);
- LONG style = GetWindowLong(ghost_hwnd, GWL_STYLE);
- LONG exstyle = GetWindowLong(ghost_hwnd, GWL_EXSTYLE);
+ LONG_PTR style = GetWindowLongPtr(ghost_hwnd, GWL_STYLE);
+ LONG_PTR exstyle = GetWindowLongPtr(ghost_hwnd, GWL_EXSTYLE);
RECT adjrc = { 0, 0, windowWidth, windowHeight };
AdjustWindowRectEx(&adjrc, style, FALSE, exstyle);
style = (style & (~(WS_POPUP|WS_OVERLAPPEDWINDOW|WS_OVERLAPPED|WS_CAPTION|WS_SYSMENU|WS_THICKFRAME|WS_MINIMIZEBOX|WS_MAXIMIZEBOX|WS_TILEDWINDOW ))) | WS_CHILD;
- SetWindowLong(ghost_hwnd, GWL_STYLE, style);
+ SetWindowLongPtr(ghost_hwnd, GWL_STYLE, style);
SetWindowPos(ghost_hwnd, NULL, adjrc.left, adjrc.top, 0, 0, SWP_NOZORDER|SWP_NOSIZE|SWP_NOACTIVATE);
/* Check the size of the client rectangle of the window and resize the window