Fixing JUCE build errors on MinGW

This commit is contained in:
Jonathan Thomas
2012-06-18 17:51:22 -05:00
parent 2f578af299
commit 9fefbcbc10
5 changed files with 16 additions and 9 deletions

View File

@@ -15,15 +15,16 @@ MESSAGE("--------------------------------------------------------------")
# Failing to do so will cause your program to be terminated when a png
# or a jpeg exception is thrown on linux or macosx.
IF (CMAKE_COMPILER_IS_GNUCC)
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fexceptions")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fexceptions")
ENDIF(CMAKE_COMPILER_IS_GNUCC)
IF (WIN32)
SET_PROPERTY(GLOBAL PROPERTY JUCE_WINDOWS "JUCE_WINDOWS")
SET_PROPERTY(GLOBAL PROPERTY JUCE_MINGW "JUCE_MINGW")
ADD_DEFINITIONS(-DDONT_AUTOLINK_TO_JUCE_LIBRARY)
SET(CMAKE_CXX_FLAGS " ${CMAKE_CXX_FLAGS} -march=i686 ")
SET(CMAKE_CXX_FLAGS " ${CMAKE_CXX_FLAGS} -march=i686")
SET(JUCE_PLATFORM_SPECIFIC_LIBRARIES
kernel32.lib

View File

@@ -87,6 +87,10 @@
#define _WIN32_IE 0x0400
#endif
#if JUCE_MINGW
#include <basetyps.h>
#endif
#include <windows.h>
#include <shellapi.h>
#include <tchar.h>
@@ -102,9 +106,7 @@
#include <shlwapi.h>
#include <mmsystem.h>
#if JUCE_MINGW
#include <basetyps.h>
#else
#if ! JUCE_MINGW
#include <crtdbg.h>
#include <comutil.h>
#endif

View File

@@ -132,12 +132,11 @@ public:
{
#if ! JUCE_MINGW
if (refId == __uuidof (ComClass)) { AddRef(); *result = dynamic_cast <ComClass*> (this); return S_OK; }
if (refId == IID_IUnknown) { AddRef(); *result = dynamic_cast <IUnknown*> (this); return S_OK; }
#else
jassertfalse; // need to find a mingw equivalent of __uuidof to make this possible
#endif
if (refId == IID_IUnknown) { AddRef(); *result = dynamic_cast <IUnknown*> (this); return S_OK; }
*result = 0;
return E_NOINTERFACE;
}

View File

@@ -443,7 +443,7 @@ namespace NumberToStringConverters
else
{
// Use a locale-free sprintf where possible (not available on linux AFAICT)
#if JUCE_WINDOWS
#if JUCE_WINDOWS && ! JUCE_MINGW
len = (size_t) _sprintf_l (buffer, "%.9g", _create_locale (LC_NUMERIC, "C"), n);
#elif JUCE_MAC || JUCE_IOS
len = (size_t) sprintf_l (buffer, nullptr, "%.9g", n);

View File

@@ -54,7 +54,12 @@ void* getUser32Function (const char* functionName) // (NB: this function also us
HMODULE user32Mod = GetModuleHandleA ("user32.dll");
jassert (user32Mod != 0);
return static_cast <void*> (GetProcAddress (user32Mod, functionName));
#if ! JUCE_MINGW
return static_cast <void*> (GetProcAddress (user32Mod, functionName));
#else
jassertfalse; // need to find a mingw equivalent
#endif
}
//==============================================================================