1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-31 03:00:05 +00:00

Workarounds to avoid clashes with stupid 3rd-party headers that rely on defining a macro called "check"

This commit is contained in:
jules 2015-12-07 19:31:05 +00:00
parent 41c2e8ea26
commit 99ebba4e4c
6 changed files with 10 additions and 4 deletions

View file

@ -22,6 +22,8 @@
==============================================================================
*/
#undef check
const char* const openSLTypeName = "Android OpenSL";
bool isOpenSLAvailable()

View file

@ -98,6 +98,8 @@
#pragma comment(lib, JucePlugin_AAXLibs_path JUCE_AAX_LIB_PATH JUCE_AAX_LIB JUCE_AAX_LIB_SUFFIX ".lib")
#endif
#undef check
using juce::Component;
const int32_t juceChunkType = 'juce';

View file

@ -114,6 +114,8 @@
#include <android/log.h>
#endif
#undef check
//==============================================================================
#ifndef JUCE_STANDALONE_APPLICATION
JUCE_COMPILER_WARNING ("Please re-save your Introjucer project with the latest Introjucer version to avoid this warning")

View file

@ -33,10 +33,10 @@
namespace HeapBlockHelper
{
template <bool shouldThrow>
struct ThrowOnFail { static void check (void*) {} };
struct ThrowOnFail { static void checkPointer (void*) {} };
template<>
struct ThrowOnFail<true> { static void check (void* data) { if (data == nullptr) throw std::bad_alloc(); } };
struct ThrowOnFail<true> { static void checkPointer (void* data) { if (data == nullptr) throw std::bad_alloc(); } };
}
#endif
@ -298,7 +298,7 @@ private:
#if JUCE_EXCEPTIONS_DISABLED
jassert (data != nullptr); // without exceptions, you'll need to find a better way to handle this failure case.
#else
HeapBlockHelper::ThrowOnFail<throwOnFailure>::check (data);
HeapBlockHelper::ThrowOnFail<throwOnFailure>::checkPointer (data);
#endif
}

View file

@ -114,7 +114,6 @@
#endif
// undef symbols that are sometimes set by misguided 3rd-party headers..
#undef check
#undef TYPE_BOOL
#undef max
#undef min

View file

@ -63,6 +63,7 @@ namespace pnglibNamespace
#pragma clang diagnostic ignored "-Wsign-conversion"
#endif
#undef check
using std::abs;
#define NO_DUMMY_DECL
#define PNGLCONF_H 1