[fixed]Patch for mingw-w64

You discovered a bug in the engine, and you are sure that it is not a problem of your code? Just post it in here. Please read the bug posting guidelines first.

[fixed]Patch for mingw-w64

Postby bob » Thu Feb 03, 2011 6:31 pm

Hello great ones. I recently updated, and had to make the following minor changes to build with mingw-w64. After that, it was a thing of beauty, I'm still weak in the knees.

Code: Select all
diff -rupwbBEN --strip-trailing-cr -x .svn ../dnl3/irrlicht/source/Irrlicht/CIrrDeviceConsole.cpp irrlicht/source/Irrlicht/CIrrDeviceConsole.cpp
--- ../dnl3/irrlicht/source/Irrlicht/CIrrDeviceConsole.cpp   2011-02-03 10:53:55.000000000 -0500
+++ irrlicht/source/Irrlicht/CIrrDeviceConsole.cpp   2011-02-03 10:41:13.000000000 -0500
@@ -75,6 +75,7 @@ CIrrDeviceConsole::CIrrDeviceConsole(con
    WindowsSTDOut = GetStdHandle(STD_OUTPUT_HANDLE);
    PCOORD Dimensions = 0;
 
+#if _WIN32_WINNT > 0x0501   
    if (CreationParams.Fullscreen)
    {
       if (SetConsoleDisplayMode(WindowsSTDOut, CONSOLE_FULLSCREEN_MODE, Dimensions))
@@ -84,6 +85,7 @@ CIrrDeviceConsole::CIrrDeviceConsole(con
       }
    }
    else
+#endif
    {
       COORD ConsoleSize;
       ConsoleSize.X = CreationParams.WindowSize.Width;
diff -rupwbBEN --strip-trailing-cr -x .svn ../dnl3/irrlicht/source/Irrlicht/CIrrDeviceWin32.h irrlicht/source/Irrlicht/CIrrDeviceWin32.h
--- ../dnl3/irrlicht/source/Irrlicht/CIrrDeviceWin32.h   2011-02-03 10:53:55.000000000 -0500
+++ irrlicht/source/Irrlicht/CIrrDeviceWin32.h   2011-02-03 10:45:29.000000000 -0500
@@ -16,7 +16,12 @@
 #if !defined(_IRR_XBOX_PLATFORM_)
    #include <windows.h>
    #include <mmsystem.h> // For JOYCAPS
+#ifndef __MINGW32__
    #include <Windowsx.h>
+#else
+   #define GET_X_LPARAM(lp) ((int)(short)LOWORD(lp))
+   #define GET_Y_LPARAM(lp) ((int)(short)HIWORD(lp))
+#endif
 #endif
 
 namespace irr
[/code]
User avatar
bob
 
Posts: 57
Joined: Fri Jun 08, 2007 4:17 am
Location: Jacksonville, Fl (USA)

Postby hybrid » Thu Feb 03, 2011 10:16 pm

Don't we have to check somewhat further for the Windowsx.h include? It looks as if there should be some version test, because mingw has this include file sometimes.
hybrid
Admin
 
Posts: 13976
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany

Postby bob » Fri Feb 04, 2011 2:46 pm

hello hybrid, I should have probably updated my compilers and researched a bit more before i posted. I figured someone would just shoot back that I needed to set the IRRLICHT_YOUR_AN_IDIOT flag.

I rebuilt from source control, and as of todays mingw versions. Both mingw32 and mingw-w64 have windowsx.h. I'm actually cross compiling on Linux, and the files are 'windowsx.h' and not 'Windowsx.h'. Changing to lower case windowsx.h fixes the issue.

mingw:wincon.h contains
Code: Select all
#if (_WIN32_WINNT >= 0x0501)
BOOL WINAPI SetConsoleDisplayMode(HANDLE,DWORD,PCOORD);
#endif


mingw-w64 doesn't contain the SetConsoleDisplayMode() function in the headers at all, tho it is in libkernel32.a, so a declaration may fix it if it's really needed.
User avatar
bob
 
Posts: 57
Joined: Fri Jun 08, 2007 4:17 am
Location: Jacksonville, Fl (USA)

Postby hybrid » Fri Feb 04, 2011 4:23 pm

Ok, I skipped over the capital W, fixed now. The other compile check is also added. I don't know, though, if it really helps with mingw-w64 then. But that sounds more like an incomplete header than a problem for our code.
hybrid
Admin
 
Posts: 13976
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany


Return to Bug reports

Who is online

Users browsing this forum: hybrid, zerochen and 0 guests