Okay, a fellow named Ben Vining on the JUCE Discord helped me out with making the file global var thing less hacky using "static" + thread-local variables.
I think it's pretty much ready to submit now =)
PHP Code:
struct AudioProcessorInitializerHelper
{
inline static juce::ThreadLocalValue<juce::AudioProcessor*> lastProcessorCreated;
static void JUCE_CALLTYPE setLastCreatedAudioProcessor(juce::AudioProcessor* p) {
lastProcessorCreated = p;
}
static juce::AudioProcessor* JUCE_CALLTYPE getLastCreatedAudioProcessor() {
return lastProcessorCreated.get();
}
};