OpenShot / libopenshot-audio

OpenShot Audio Library (libopenshot-audio) is a free, open-source project that enables high-quality editing and playback of audio, and is based on the amazing JUCE library.
http://www.openshot.org
GNU General Public License v3.0
254 stars 101 forks source link

Fix legacy JuceHeader.h #124

Closed ferdnyc closed 3 years ago

ferdnyc commented 3 years ago

My recent #118 changed the name of the primary header from JuceHeader.h to OpenShotAudio.h, but also installed that file as a link/copy under the name JuceHeader.h for backwards compatibility.

Turns out, that's a problem if you happen to mix both #include forms in the same project, because you'll end up with errors about symbols being redefined or duplicated. So, this PR replaces the copy/link to JuceHeader.h with a new stub file that contains only two business lines:

#pragma once
#include "./OpenShotAudio.h"

That way, nothing breaks if both files are #included together.

ferdnyc commented 3 years ago

(Traditional include guards might've prevented this, I'm not sure — but probably. Which you could argue is a point in favor of traditional guards over the #pragma once form JUCE uses, but I'm not so sure. Even if they did prevent the errors, that would've just been enabling poor design, whereas the #pragma once form forced me to solve this the right way, like I should've from the beginning.)