1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Deleted some defunct Mac PowerPC code

This commit is contained in:
jules 2016-04-19 16:46:45 +01:00
parent 42a956c9c6
commit 4c0bc70411
6 changed files with 8 additions and 197 deletions

View file

@ -203,18 +203,6 @@ namespace
return FSPathMakeRef (reinterpret_cast<const UInt8*> (path.toRawUTF8()), destFSRef, 0) == noErr;
}
#endif
#if JUCE_MAC && JUCE_PPC
static void* newCFMFromMachO (void* const machofp) noexcept
{
void* result = (void*) new char[8];
((void**) result)[0] = machofp;
((void**) result)[1] = result;
return result;
}
#endif
}
//==============================================================================
@ -385,9 +373,6 @@ public:
ModuleHandle (const File& f)
: file (f), moduleMain (nullptr), customMain (nullptr)
#if JUCE_MAC
#if JUCE_PPC
, fragId (0)
#endif
, resHandle (0), bundleRef (0), resFileId (0)
#endif
{
@ -473,9 +458,6 @@ public:
}
#endif
#else
#if JUCE_PPC
CFragConnectionID fragId;
#endif
Handle resHandle;
CFBundleRef bundleRef;
FSSpec parentDirFSSpec;
@ -545,80 +527,12 @@ public:
}
}
}
#if JUCE_PPC
else
{
FSRef fn;
if (FSPathMakeRef ((UInt8*) file.getFullPathName().toRawUTF8(), &fn, 0) == noErr)
{
resFileId = FSOpenResFile (&fn, fsRdPerm);
if (resFileId != -1)
{
const int numEffs = Count1Resources ('aEff');
for (int i = 0; i < numEffs; ++i)
{
resHandle = Get1IndResource ('aEff', i + 1);
if (resHandle != 0)
{
OSType type;
Str255 name;
SInt16 id;
GetResInfo (resHandle, &id, &type, name);
pluginName = String ((const char*) name + 1, name[0]);
DetachResource (resHandle);
HLock (resHandle);
::Ptr ptr;
Str255 errorText;
OSErr err = GetMemFragment (*resHandle, GetHandleSize (resHandle),
name, kPrivateCFragCopy,
&fragId, &ptr, errorText);
if (err == noErr)
{
moduleMain = (MainCall) newMachOFromCFM (ptr);
ok = true;
}
else
{
HUnlock (resHandle);
}
break;
}
}
if (! ok)
CloseResFile (resFileId);
}
}
}
#endif
return ok;
}
void close()
{
#if JUCE_PPC
if (fragId != 0)
{
if (moduleMain != nullptr)
disposeMachOFromCFM ((void*) moduleMain);
CloseConnection (&fragId);
HUnlock (resHandle);
if (resFileId != 0)
CloseResFile (resFileId);
}
else
#endif
if (bundleRef != 0)
{
CFBundleCloseBundleResourceMap (bundleRef, resFileId);
@ -633,65 +547,9 @@ public:
void closeEffect (AEffect* eff)
{
#if JUCE_PPC
if (fragId != 0)
{
Array<void*> thingsToDelete;
thingsToDelete.add ((void*) eff->dispatcher);
thingsToDelete.add ((void*) eff->process);
thingsToDelete.add ((void*) eff->setParameter);
thingsToDelete.add ((void*) eff->getParameter);
thingsToDelete.add ((void*) eff->processReplacing);
eff->dispatcher (eff, effClose, 0, 0, 0, 0);
for (int i = thingsToDelete.size(); --i >= 0;)
disposeMachOFromCFM (thingsToDelete[i]);
}
else
#endif
{
eff->dispatcher (eff, effClose, 0, 0, 0, 0);
}
eff->dispatcher (eff, effClose, 0, 0, 0, 0);
}
#if JUCE_PPC
static void* newMachOFromCFM (void* cfmfp)
{
if (cfmfp == 0)
return nullptr;
UInt32* const mfp = new UInt32[6];
mfp[0] = 0x3d800000 | ((UInt32) cfmfp >> 16);
mfp[1] = 0x618c0000 | ((UInt32) cfmfp & 0xffff);
mfp[2] = 0x800c0000;
mfp[3] = 0x804c0004;
mfp[4] = 0x7c0903a6;
mfp[5] = 0x4e800420;
MakeDataExecutable (mfp, sizeof (UInt32) * 6);
return mfp;
}
static void disposeMachOFromCFM (void* ptr)
{
delete[] static_cast<UInt32*> (ptr);
}
void coerceAEffectFunctionCalls (AEffect* eff)
{
if (fragId != 0)
{
eff->dispatcher = (AEffectDispatcherProc) newMachOFromCFM ((void*) eff->dispatcher);
eff->process = (AEffectProcessProc) newMachOFromCFM ((void*) eff->process);
eff->setParameter = (AEffectSetParameterProc) newMachOFromCFM ((void*) eff->setParameter);
eff->getParameter = (AEffectGetParameterProc) newMachOFromCFM ((void*) eff->getParameter);
eff->processReplacing = (AEffectProcessProc) newMachOFromCFM ((void*) eff->processReplacing);
}
}
#endif
#endif
private:
@ -732,29 +590,14 @@ public:
#if JUCE_MAC
if (module->resFileId != 0)
UseResFile (module->resFileId);
#if JUCE_PPC
if (module->fragId != 0)
{
static void* audioMasterCoerced = nullptr;
if (audioMasterCoerced == nullptr)
audioMasterCoerced = newCFMFromMachO ((void*) &audioMaster);
effect = module->moduleMain ((audioMasterCallback) audioMasterCoerced);
}
else
#endif
#endif
{
JUCE_VST_WRAPPER_INVOKE_MAIN
}
if (effect != nullptr && effect->magic == kEffectMagic)
{
#if JUCE_PPC
module->coerceAEffectFunctionCalls (effect);
#endif
jassert (effect->resvd2 == 0);
jassert (effect->object != 0);
@ -2834,27 +2677,7 @@ bool VSTPluginFormat::fileMightContainThisPluginType (const String& fileOrIdenti
const File f (File::createFileWithoutCheckingPath (fileOrIdentifier));
#if JUCE_MAC
if (f.isDirectory() && f.hasFileExtension (".vst"))
return true;
#if JUCE_PPC
FSRef fileRef;
if (makeFSRefFromPath (&fileRef, f.getFullPathName()))
{
const short resFileId = FSOpenResFile (&fileRef, fsRdPerm);
if (resFileId != -1)
{
const int numEffects = Count1Resources ('aEff');
CloseResFile (resFileId);
if (numEffects > 0)
return true;
}
}
#endif
return false;
return f.isDirectory() && f.hasFileExtension (".vst");
#elif JUCE_WINDOWS
return f.existsAsFile() && f.hasFileExtension (".dll");
#elif JUCE_LINUX

View file

@ -187,19 +187,9 @@ private:
/*
The following code is in the header so that the atomics can be inlined where possible...
*/
#if JUCE_MAC && (JUCE_PPC || __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 2))
#if JUCE_MAC && (__GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 2))
#define JUCE_ATOMICS_MAC_LEGACY 1 // Older OSX builds using gcc4.1 or earlier
#if JUCE_PPC
// None of these atomics are available for PPC or for iOS 3.1 or earlier!!
template <typename Type> static Type OSAtomicAdd64Barrier (Type b, volatile Type* a) noexcept { jassertfalse; return *a += b; }
template <typename Type> static Type OSAtomicIncrement64Barrier (volatile Type* a) noexcept { jassertfalse; return ++*a; }
template <typename Type> static Type OSAtomicDecrement64Barrier (volatile Type* a) noexcept { jassertfalse; return --*a; }
template <typename Type> static bool OSAtomicCompareAndSwap64Barrier (Type old, Type newValue, volatile Type* value) noexcept
{ jassertfalse; if (old == *value) { *value = newValue; return true; } return false; }
#define JUCE_64BIT_ATOMICS_UNAVAILABLE 1
#endif
//==============================================================================
#elif JUCE_GCC || JUCE_CLANG
#define JUCE_ATOMICS_GCC 1 // GCC with intrinsics

View file

@ -86,7 +86,7 @@ namespace
typedef id (*MsgSendSuperFn) (struct objc_super*, SEL, ...);
static inline MsgSendSuperFn getMsgSendSuperFn() noexcept { return (MsgSendSuperFn) (void*) objc_msgSendSuper; }
#if ! JUCE_PPC && ! JUCE_IOS
#if ! JUCE_IOS
typedef double (*MsgSendFPRetFn) (id, SEL op, ...);
static inline MsgSendFPRetFn getMsgSendFPRetFn() noexcept { return (MsgSendFPRetFn) (void*) objc_msgSend_fpret; }
#endif

View file

@ -61,7 +61,7 @@
#endif
//==============================================================================
#if JUCE_IOS || JUCE_LINUX || JUCE_ANDROID || JUCE_PPC
#if JUCE_IOS || JUCE_LINUX || JUCE_ANDROID
/** This will try to break into the debugger if the app is currently being debugged.
If called by an app that's not being debugged, the behaviour isn't defined - it may
crash or not, depending on the platform.

View file

@ -38,7 +38,7 @@
- One of JUCE_WINDOWS, JUCE_MAC JUCE_LINUX, JUCE_IOS, JUCE_ANDROID, etc.
- Either JUCE_32BIT or JUCE_64BIT, depending on the architecture.
- Either JUCE_LITTLE_ENDIAN or JUCE_BIG_ENDIAN.
- Either JUCE_INTEL or JUCE_PPC
- Either JUCE_INTEL or JUCE_ARM
- Either JUCE_GCC or JUCE_CLANG or JUCE_MSVC
*/
@ -141,7 +141,7 @@
#endif
#if defined (__ppc__) || defined (__ppc64__)
#define JUCE_PPC 1
#error "PowerPC is no longer supported by JUCE!"
#elif defined (__arm__) || defined (__arm64__)
#define JUCE_ARM 1
#else

View file

@ -615,7 +615,6 @@ public:
wheel.isSmooth = false;
wheel.isInertial = false;
#if ! JUCE_PPC
@try
{
#if defined (MAC_OS_X_VERSION_10_7) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7
@ -644,7 +643,6 @@ public:
}
@catch (...)
{}
#endif
if (wheel.deltaX == 0 && wheel.deltaY == 0)
{