Work on compiling on mingw

This commit is contained in:
Lymia Aluysia
2017-01-18 04:56:16 -06:00
parent cc76e26495
commit 8c960f0c34
8 changed files with 47 additions and 42 deletions
+1 -1
View File
@@ -200,7 +200,7 @@ int string_format_args(const String& str) {
*/
InputStreamP load_resource_text(const String& name);
InputStreamP load_resource_text(const String& name) {
#if defined(__WXMSW__)
#if defined(__WXMSW__) && !defined(__GNUC__)
HRSRC hResource = ::FindResource(wxGetInstance(), name, _("TEXT"));
if ( hResource == 0 ) throw InternalError(String::Format(_("Resource not found: %s"), name));
HGLOBAL hData = ::LoadResource(wxGetInstance(), hResource);
+6 -6
View File
@@ -129,7 +129,7 @@ void draw_checker(RotatedDC& dc, const RealRect& rect) {
// ----------------------------------------------------------------------------- : Resource related
Image load_resource_image(const String& name) {
#if defined(__WXMSW__)
#if defined(__WXMSW__) && !defined(__GNUC__)
// Load resource
// based on wxLoadUserResource
// The image can be in an IMAGE resource, in any file format
@@ -145,7 +145,7 @@ Image load_resource_image(const String& name) {
int len = ::SizeofResource(wxGetInstance(), hResource);
wxMemoryInputStream stream(data, len);
return wxImage(stream);
#elif defined(__linux__)
#elif defined(__GNUC__)
static String path = wxStandardPaths::Get().GetDataDir() + _("/resource/");
String file = path + name;
wxImage resource;
@@ -168,7 +168,7 @@ Image load_resource_image(const String& name) {
}
wxCursor load_resource_cursor(const String& name) {
#if defined(__WXMSW__)
#if defined(__WXMSW__) && !defined(__GNUC__)
return wxCursor(_("cursor/") + name, wxBITMAP_TYPE_CUR_RESOURCE);
#else
return wxCursor(load_resource_image(_("cursor/") + name));
@@ -176,7 +176,7 @@ wxCursor load_resource_cursor(const String& name) {
}
wxIcon load_resource_icon(const String& name) {
#if defined(__WXMSW__)
#if defined(__WXMSW__) && !defined(__GNUC__)
return wxIcon(_("icon/") + name);
#else
static String path = wxStandardPaths::Get().GetDataDir() + _("/resource/icon/");
@@ -187,7 +187,7 @@ wxIcon load_resource_icon(const String& name) {
}
wxBitmap load_resource_tool_image(const String& name) {
#if defined(__WXMSW__)
#if defined(__WXMSW__) && !defined(__GNUC__)
return load_resource_image(_("tool/") + name);
#else
return load_resource_image(_("tool/") + name);
@@ -379,4 +379,4 @@ void enable_themed_selection_rectangle(Window* win) {
themeEngine->SetWindowTheme((HWND)win->GetHWND(), L"Explorer", NULL);
}
#endif
}
}
+1 -1
View File
@@ -23,7 +23,7 @@ DECLARE_POINTER_TYPE(FunctionProfile);
// ----------------------------------------------------------------------------- : Timer
#ifdef WIN32
#ifdef _MSC_VER
typedef LONGLONG ProfileTime;
inline ProfileTime timer_now() {
+5
View File
@@ -31,6 +31,11 @@
#include <wx/datetime.h>
#include <wx/regex.h> // TODO : remove, see regex.hpp
#if defined(__WXMSW__) && defined(__GNUC__)
// MSW uses the RGB define, fix it before it's undefined
#include <wx/msw/private.h>
#endif
// Std headers
#include <vector>
#include <map>