Skip to content

Commit

Permalink
Fix bug in 64bit windows
Browse files Browse the repository at this point in the history
Windows use LLP64 mode, the long is still 32bit. So we need to use
LONGLONG when calling SetWindowLongPtr.
  • Loading branch information
Ming Fang authored and Ming Fang committed Jul 2, 2016
1 parent 63090fb commit 8e1d4ce
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Common/Source/Win32/esUtil_win32.c
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,12 @@ GLboolean WinCreate ( ESContext *esContext, const char *title )

// Set the ESContext* to the GWL_USERDATA so that it is available to the
// ESWindowProc
SetWindowLongPtr ( esContext->eglNativeWindow, GWL_USERDATA, ( LONG ) ( LONG_PTR ) esContext );
#ifdef _WIN64
//In LLP64 LONG is stll 32bit.
SetWindowLongPtr( esContext->eglNativeWindow, GWL_USERDATA, ( LONGLONG ) ( LONG_PTR )esContext);
#else
SetWindowLongPtr ( esContext->eglNativeWindow, GWL_USERDATA, ( LONG ) ( LONG_PTR ) esContext );
#endif


if ( esContext->eglNativeWindow == NULL )
Expand Down

0 comments on commit 8e1d4ce

Please sign in to comment.