From 4980966ba06f2cf26e209a9d4ada7c6951aadd13 Mon Sep 17 00:00:00 2001 From: falkTX Date: Sun, 5 Nov 2017 20:22:05 +0100 Subject: [PATCH] Include needed headers directly in water cpp files --- .../water/containers/ArrayAllocationBase.h | 2 ++ source/modules/water/files/File.cpp | 12 +++++++ source/modules/water/maths/MathsFunctions.h | 2 ++ source/modules/water/memory/Memory.h | 2 ++ source/modules/water/midi/MidiBuffer.cpp | 2 ++ source/modules/water/misc/Time.cpp | 3 ++ .../modules/water/processors/AudioProcessor.h | 2 ++ source/modules/water/text/CharPointer_UTF8.h | 2 ++ .../modules/water/text/CharacterFunctions.cpp | 2 ++ source/modules/water/text/String.cpp | 3 ++ source/modules/water/text/StringPool.h | 2 ++ source/modules/water/threads/ChildProcess.cpp | 5 +++ source/modules/water/water.cpp | 31 +------------------ 13 files changed, 40 insertions(+), 30 deletions(-) diff --git a/source/modules/water/containers/ArrayAllocationBase.h b/source/modules/water/containers/ArrayAllocationBase.h index b3d3b0717..783017c20 100644 --- a/source/modules/water/containers/ArrayAllocationBase.h +++ b/source/modules/water/containers/ArrayAllocationBase.h @@ -28,6 +28,8 @@ #include "../memory/HeapBlock.h" +#include "CarlaUtils.hpp" + namespace water { //============================================================================== diff --git a/source/modules/water/files/File.cpp b/source/modules/water/files/File.cpp index 1a240893c..ef60bf675 100644 --- a/source/modules/water/files/File.cpp +++ b/source/modules/water/files/File.cpp @@ -34,6 +34,18 @@ #include "CarlaJuceUtils.hpp" +#ifndef CARLA_OS_WIN +# include +# include +# include +# include +# ifdef CARLA_OS_MAC +# else +# include +# include +# endif +#endif + namespace water { File::File (const String& fullPathName) diff --git a/source/modules/water/maths/MathsFunctions.h b/source/modules/water/maths/MathsFunctions.h index cf6da687f..0504a7394 100644 --- a/source/modules/water/maths/MathsFunctions.h +++ b/source/modules/water/maths/MathsFunctions.h @@ -28,6 +28,8 @@ #include "../water.h" +#include "CarlaUtils.hpp" + #include namespace water { diff --git a/source/modules/water/memory/Memory.h b/source/modules/water/memory/Memory.h index de005c8bb..69607d8ac 100644 --- a/source/modules/water/memory/Memory.h +++ b/source/modules/water/memory/Memory.h @@ -28,6 +28,8 @@ #include "../water.h" +#include + namespace water { //============================================================================== diff --git a/source/modules/water/midi/MidiBuffer.cpp b/source/modules/water/midi/MidiBuffer.cpp index 9e74de5af..bb8cac3ad 100644 --- a/source/modules/water/midi/MidiBuffer.cpp +++ b/source/modules/water/midi/MidiBuffer.cpp @@ -26,6 +26,8 @@ #include "MidiBuffer.h" #include "MidiMessage.h" +#include "CarlaUtils.hpp" + namespace water { namespace MidiBufferHelpers diff --git a/source/modules/water/misc/Time.cpp b/source/modules/water/misc/Time.cpp index 032d44141..5255337fb 100644 --- a/source/modules/water/misc/Time.cpp +++ b/source/modules/water/misc/Time.cpp @@ -25,6 +25,9 @@ #include "Time.h" +#include +#include + namespace water { namespace TimeHelpers diff --git a/source/modules/water/processors/AudioProcessor.h b/source/modules/water/processors/AudioProcessor.h index b10f4b5c7..1fe988d73 100644 --- a/source/modules/water/processors/AudioProcessor.h +++ b/source/modules/water/processors/AudioProcessor.h @@ -29,6 +29,8 @@ #include "../text/String.h" #include "../buffers/AudioSampleBuffer.h" +#include "CarlaMutex.hpp" + namespace water { //============================================================================== diff --git a/source/modules/water/text/CharPointer_UTF8.h b/source/modules/water/text/CharPointer_UTF8.h index 63505917f..767c7c5bf 100644 --- a/source/modules/water/text/CharPointer_UTF8.h +++ b/source/modules/water/text/CharPointer_UTF8.h @@ -29,6 +29,8 @@ #include "CharacterFunctions.h" #include "../memory/Atomic.h" +#include "CarlaUtils.hpp" + namespace water { //============================================================================== diff --git a/source/modules/water/text/CharacterFunctions.cpp b/source/modules/water/text/CharacterFunctions.cpp index dec8f1441..6af35f925 100644 --- a/source/modules/water/text/CharacterFunctions.cpp +++ b/source/modules/water/text/CharacterFunctions.cpp @@ -25,6 +25,8 @@ #include "CharacterFunctions.h" +#include + namespace water { //============================================================================== diff --git a/source/modules/water/text/String.cpp b/source/modules/water/text/String.cpp index b38ec68a6..c68b904ca 100644 --- a/source/modules/water/text/String.cpp +++ b/source/modules/water/text/String.cpp @@ -31,6 +31,9 @@ #include "CarlaJuceUtils.hpp" +#include +#include + namespace water { NewLine newLine; diff --git a/source/modules/water/text/StringPool.h b/source/modules/water/text/StringPool.h index b94f14e2c..57c62aba7 100644 --- a/source/modules/water/text/StringPool.h +++ b/source/modules/water/text/StringPool.h @@ -28,6 +28,8 @@ #include "../containers/Array.h" +#include "CarlaMutex.hpp" + namespace water { //============================================================================== diff --git a/source/modules/water/threads/ChildProcess.cpp b/source/modules/water/threads/ChildProcess.cpp index e694721c3..58c7a8844 100644 --- a/source/modules/water/threads/ChildProcess.cpp +++ b/source/modules/water/threads/ChildProcess.cpp @@ -28,6 +28,11 @@ #include "../misc/Time.h" #include "../streams/MemoryOutputStream.h" +#ifndef CARLA_OS_WIN +# include +# include +#endif + #define JUCE_USE_VFORK 1 namespace water { diff --git a/source/modules/water/water.cpp b/source/modules/water/water.cpp index e7a323632..b1e136b01 100644 --- a/source/modules/water/water.cpp +++ b/source/modules/water/water.cpp @@ -16,34 +16,6 @@ * For a full copy of the GNU General Public License see the doc/GPL.txt file. */ -#include "water.h" - -#include "CarlaMutex.hpp" - -#include -#include -#include -#include -#include -#include - -#ifdef CARLA_OS_WIN - #include - #include -#else - #include - #include - #include - #include - #include - #include - #ifdef CARLA_OS_MAC - #else - #include - #include - #endif -#endif - #include "misc/Result.h" //============================================================================== @@ -79,7 +51,6 @@ void* Process::getCurrentModuleInstanceHandle() noexcept return currentModuleHandle; } - #else static Result getResultForErrno() { @@ -91,7 +62,7 @@ static void* fdToVoidPointer (int fd) noexcept { return (void*) (pointer_sized_ static int64 juce_fileSetPosition (void* handle, int64 pos) { - if (handle != 0 && lseek (getFD (handle), pos, SEEK_SET) == pos) + if (handle != nullptr && lseek (getFD (handle), pos, SEEK_SET) == pos) return pos; return -1;