Kaydet (Commit) 3e7eb8bc authored tarafından Fridrich Štrba's avatar Fridrich Štrba

mingw64: Use the *LongPtr Windows api

Change-Id: I00c753f71460bee9f2bce3af35b352a25a3b8484
üst 90e16066
...@@ -27,28 +27,19 @@ ...@@ -27,28 +27,19 @@
************************************************************************/ ************************************************************************/
#ifdef WNT #include "nsp_windows.hxx"
#ifdef _MSC_VER
#pragma warning (push,1)
#pragma warning (disable:4668)
#endif
#include <windows.h>
#ifdef _MSC_VER
#pragma warning (pop)
#endif
#endif
int NSP_ResetWinStyl(long hParent) int NSP_ResetWinStyl(LONG_PTR hParent)
{ {
int ret = 0; int ret = 0;
#ifdef WNT #ifdef WNT
LONG dOldStyl = GetWindowLong( (HWND)hParent, GWL_STYLE); LONG_PTR dOldStyl = GetWindowLongPtr( (HWND)hParent, GWL_STYLE);
ret = dOldStyl; ret = dOldStyl;
if(ret != 0) if(ret != 0)
{ {
LONG dNewStyl = dOldStyl|WS_CLIPCHILDREN; LONG_PTR dNewStyl = dOldStyl|WS_CLIPCHILDREN;
if(0 == SetWindowLong((HWND)hParent, GWL_STYLE, dNewStyl)) if(0 == SetWindowLongPtr((HWND)hParent, GWL_STYLE, dNewStyl))
ret = 0; ret = 0;
} }
#endif #endif
...@@ -56,11 +47,11 @@ int NSP_ResetWinStyl(long hParent) ...@@ -56,11 +47,11 @@ int NSP_ResetWinStyl(long hParent)
} }
int NSP_RestoreWinStyl(long hParent, long dOldStyle) int NSP_RestoreWinStyl(LONG_PTR hParent, LONG_PTR dOldStyle)
{ {
int ret = 0; int ret = 0;
#ifdef WNT #ifdef WNT
ret = SetWindowLong((HWND)hParent, GWL_STYLE, dOldStyle); ret = SetWindowLongPtr((HWND)hParent, GWL_STYLE, dOldStyle);
#endif #endif
return ret; return ret;
} }
......
...@@ -28,10 +28,23 @@ ...@@ -28,10 +28,23 @@
#ifndef __NSP_WINDOWS_HXX__ #ifndef __NSP_WINDOWS_HXX__
#define __NSP_WINDOWS_HXX__ #define __NSP_WINDOWS_HXX__
#ifdef WNT
#ifdef _MSC_VER
#pragma warning (push,1)
#pragma warning (disable:4668)
#endif
#include <windows.h>
#ifdef _MSC_VER
#pragma warning (pop)
#endif
#else
#ifndef LONG_PTR
#define LONG_PTR long
#endif
#endif
int NSP_ResetWinStyl(LONG_PTR hParent);
int NSP_ResetWinStyl(long hParent); int NSP_RestoreWinStyl(LONG_PTR hParent, LONG_PTR dOldStyle);
int NSP_RestoreWinStyl(long hParent, long dOldStyle);
#endif #endif
......
...@@ -449,8 +449,8 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv) ...@@ -449,8 +449,8 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
iPipe[1] = atoi(argv[2]); iPipe[1] = atoi(argv[2]);
// fd_pipe[0]: read, fd_pipe[0]: write // fd_pipe[0]: read, fd_pipe[0]: write
fd_pipe[0] = (NSP_PIPE_FD) iPipe[0] ; fd_pipe[0] = (NSP_PIPE_FD) (sal_IntPtr) iPipe[0] ;
fd_pipe[1] = (NSP_PIPE_FD) iPipe[1] ; fd_pipe[1] = (NSP_PIPE_FD) (sal_IntPtr) iPipe[1] ;
NSP_Close_Pipe(fd_pipe[1]); NSP_Close_Pipe(fd_pipe[1]);
if(iPipe[0] < 0) if(iPipe[0] < 0)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment