Browse Source

Fix mingw build

tags/1.9.7
falkTX 9 years ago
parent
commit
a1eac6e419
11 changed files with 51 additions and 39 deletions
  1. +1
    -3
      source/modules/juce_audio_devices/native/juce_win32_ASIO.cpp
  2. +3
    -9
      source/modules/juce_audio_formats/codecs/juce_AiffAudioFormat.cpp
  3. +17
    -17
      source/modules/juce_audio_formats/codecs/juce_WavAudioFormat.cpp
  4. +11
    -1
      source/modules/juce_core/containers/juce_Array.h
  5. +1
    -1
      source/modules/juce_core/files/juce_File.cpp
  6. +1
    -1
      source/modules/juce_core/native/juce_BasicNativeHeaders.h
  7. +10
    -1
      source/modules/juce_core/native/juce_win32_Files.cpp
  8. +1
    -1
      source/modules/juce_core/system/juce_StandardHeader.h
  9. +1
    -1
      source/modules/juce_core/zip/juce_GZIPCompressorOutputStream.cpp
  10. +4
    -4
      source/modules/juce_core/zip/juce_GZIPCompressorOutputStream.h
  11. +1
    -0
      source/modules/juce_gui_basics/widgets/juce_TextEditor.cpp

+ 1
- 3
source/modules/juce_audio_devices/native/juce_win32_ASIO.cpp View File

@@ -941,9 +941,7 @@ private:
} }
bufferSizes.addIfNotAlreadyThere (preferredSize); bufferSizes.addIfNotAlreadyThere (preferredSize);
DefaultElementComparator <int> comparator;
bufferSizes.sort (comparator);
bufferSizes.sort();
} }
double getSampleRate() const double getSampleRate() const


+ 3
- 9
source/modules/juce_audio_formats/codecs/juce_AiffAudioFormat.cpp View File

@@ -889,17 +889,11 @@ public:
void readMaxLevels (int64 startSampleInFile, int64 numSamples, Range<float>* results, int numChannelsToRead) override void readMaxLevels (int64 startSampleInFile, int64 numSamples, Range<float>* results, int numChannelsToRead) override
{ {
if (numSamples <= 0)
{
for (int i = 0; i < numChannelsToRead; ++i)
results[i] = Range<float>();
numSamples = jmin (numSamples, lengthInSamples - startSampleInFile);
return;
}
if (map == nullptr || ! mappedSection.contains (Range<int64> (startSampleInFile, startSampleInFile + numSamples)))
if (map == nullptr || numSamples <= 0 || ! mappedSection.contains (Range<int64> (startSampleInFile, startSampleInFile + numSamples)))
{ {
jassertfalse; // you must make sure that the window contains all the samples you're going to attempt to read.
jassert (numSamples <= 0); // you must make sure that the window contains all the samples you're going to attempt to read.
for (int i = 0; i < numChannelsToRead; ++i) for (int i = 0; i < numChannelsToRead; ++i)
results[i] = Range<float>(); results[i] = Range<float>();


+ 17
- 17
source/modules/juce_audio_formats/codecs/juce_WavAudioFormat.cpp View File

@@ -650,17 +650,23 @@ namespace WavFileHelpers
{ {
while (input.getPosition() < chunkEnd) while (input.getPosition() < chunkEnd)
{ {
const int infoType = input.readInt();
const int64 infoLength = jlimit ((int64) 0, chunkEnd - input.getPosition(), (int64) input.readInt());
const int infoType = input.readInt();
for (int i = 0; i < numElementsInArray (types); ++i)
int64 infoLength = chunkEnd - input.getPosition();
if (infoLength > 0)
{ {
if (isMatchingTypeIgnoringCase (infoType, types[i]))
infoLength = jlimit ((int64) 0, infoLength, (int64) input.readInt());
for (int i = 0; i < numElementsInArray (types); ++i)
{ {
MemoryBlock mb;
input.readIntoMemoryBlock (mb, (ssize_t) infoLength);
values.set (types[i], mb.toString());
break;
if (isMatchingTypeIgnoringCase (infoType, types[i]))
{
MemoryBlock mb;
input.readIntoMemoryBlock (mb, (ssize_t) infoLength);
values.set (types[i], mb.toString());
break;
}
} }
} }
} }
@@ -1513,17 +1519,11 @@ public:
void readMaxLevels (int64 startSampleInFile, int64 numSamples, Range<float>* results, int numChannelsToRead) override void readMaxLevels (int64 startSampleInFile, int64 numSamples, Range<float>* results, int numChannelsToRead) override
{ {
if (numSamples <= 0)
{
for (int i = 0; i < numChannelsToRead; ++i)
results[i] = Range<float>();
return;
}
numSamples = jmin (numSamples, lengthInSamples - startSampleInFile);
if (map == nullptr || ! mappedSection.contains (Range<int64> (startSampleInFile, startSampleInFile + numSamples)))
if (map == nullptr || numSamples <= 0 || ! mappedSection.contains (Range<int64> (startSampleInFile, startSampleInFile + numSamples)))
{ {
jassertfalse; // you must make sure that the window contains all the samples you're going to attempt to read.
jassert (numSamples <= 0); // you must make sure that the window contains all the samples you're going to attempt to read.
for (int i = 0; i < numChannelsToRead; ++i) for (int i = 0; i < numChannelsToRead; ++i)
results[i] = Range<float>(); results[i] = Range<float>();


+ 11
- 1
source/modules/juce_core/containers/juce_Array.h View File

@@ -1053,6 +1053,16 @@ public:
} }
//============================================================================== //==============================================================================
/** Sorts the array using a default comparison operation.
If the type of your elements isn't supported by the DefaultElementComparator class
then you may need to use the other version of sort, which takes a custom comparator.
*/
void sort()
{
DefaultElementComparator<ElementType> comparator;
sort (comparator);
}
/** Sorts the elements in the array. /** Sorts the elements in the array.
This will use a comparator object to sort the elements into order. The object This will use a comparator object to sort the elements into order. The object
@@ -1081,7 +1091,7 @@ public:
*/ */
template <class ElementComparator> template <class ElementComparator>
void sort (ElementComparator& comparator, void sort (ElementComparator& comparator,
const bool retainOrderOfEquivalentItems = false) const
const bool retainOrderOfEquivalentItems = false)
{ {
const ScopedLockType lock (getLock()); const ScopedLockType lock (getLock());
(void) comparator; // if you pass in an object with a static compareElements() method, this (void) comparator; // if you pass in an object with a static compareElements() method, this


+ 1
- 1
source/modules/juce_core/files/juce_File.cpp View File

@@ -911,7 +911,7 @@ bool File::createSymbolicLink (const File& linkFileToCreate, bool overwriteExist
} }
return true; return true;
#elif JUCE_WINDOWS
#elif JUCE_MSVC
return CreateSymbolicLink (linkFileToCreate.getFullPathName().toWideCharPointer(), return CreateSymbolicLink (linkFileToCreate.getFullPathName().toWideCharPointer(),
fullPath.toWideCharPointer(), fullPath.toWideCharPointer(),
isDirectory() ? SYMBOLIC_LINK_FLAG_DIRECTORY : 0) != FALSE; isDirectory() ? SYMBOLIC_LINK_FLAG_DIRECTORY : 0) != FALSE;


+ 1
- 1
source/modules/juce_core/native/juce_BasicNativeHeaders.h View File

@@ -114,7 +114,7 @@
#if JUCE_MINGW #if JUCE_MINGW
#include <basetyps.h> #include <basetyps.h>
#include <sys/time.h> #include <sys/time.h>
#define alloca __builtin_alloca
#define alloca(x) __builtin_alloca((x))
#else #else
#include <crtdbg.h> #include <crtdbg.h>
#include <comutil.h> #include <comutil.h>


+ 10
- 1
source/modules/juce_core/native/juce_win32_Files.cpp View File

@@ -643,6 +643,7 @@ bool File::isShortcut() const
File File::getLinkedTarget() const File File::getLinkedTarget() const
{ {
#if JUCE_MSVC
{ {
HANDLE h = CreateFile (getFullPathName().toWideCharPointer(), HANDLE h = CreateFile (getFullPathName().toWideCharPointer(),
GENERIC_READ, FILE_SHARE_READ, nullptr, GENERIC_READ, FILE_SHARE_READ, nullptr,
@@ -662,13 +663,21 @@ File File::getLinkedTarget() const
if (requiredSize > 0) if (requiredSize > 0)
{ {
CloseHandle (h); CloseHandle (h);
return File (String (buffer));
const StringRef prefix ("\\\\?\\");
const String path (buffer);
// It turns out that GetFinalPathNameByHandleW prepends \\?\ to the path.
// This is not a bug, it's feature. See MSDN for more information.
return File (path.startsWith (prefix) ? path.substring (prefix.length())
: path);
} }
} }
CloseHandle (h); CloseHandle (h);
} }
} }
#endif
File result (*this); File result (*this);
String p (getFullPathName()); String p (getFullPathName());


+ 1
- 1
source/modules/juce_core/system/juce_StandardHeader.h View File

@@ -36,7 +36,7 @@
*/ */
#define JUCE_MAJOR_VERSION 4 #define JUCE_MAJOR_VERSION 4
#define JUCE_MINOR_VERSION 0 #define JUCE_MINOR_VERSION 0
#define JUCE_BUILDNUMBER 1
#define JUCE_BUILDNUMBER 2
/** Current Juce version number. /** Current Juce version number.


+ 1
- 1
source/modules/juce_core/zip/juce_GZIPCompressorOutputStream.cpp View File

@@ -30,7 +30,7 @@ class GZIPCompressorOutputStream::GZIPCompressorHelper
{ {
public: public:
GZIPCompressorHelper (const int compressionLevel, const int windowBits) GZIPCompressorHelper (const int compressionLevel, const int windowBits)
: compLevel ((compressionLevel < 1 || compressionLevel > 9) ? -1 : compressionLevel),
: compLevel ((compressionLevel < 0 || compressionLevel > 9) ? -1 : compressionLevel),
isFirstDeflate (true), isFirstDeflate (true),
streamIsValid (false), streamIsValid (false),
finished (false) finished (false)


+ 4
- 4
source/modules/juce_core/zip/juce_GZIPCompressorOutputStream.h View File

@@ -48,9 +48,9 @@ public:
@param destStream the stream into which the compressed data should @param destStream the stream into which the compressed data should
be written be written
@param compressionLevel how much to compress the data, between 1 and 9, where
1 is the fastest/lowest compression, and 9 is the
slowest/highest compression. Any value outside this range
@param compressionLevel how much to compress the data, between 0 and 9, where
0 is non-compressed storage, 1 is the fastest/lowest compression,
and 9 is the slowest/highest compression. Any value outside this range
indicates that a default compression level should be used. indicates that a default compression level should be used.
@param deleteDestStreamWhenDestroyed whether or not to delete the destStream object when @param deleteDestStreamWhenDestroyed whether or not to delete the destStream object when
this stream is destroyed this stream is destroyed
@@ -59,7 +59,7 @@ public:
its value for some reason its value for some reason
*/ */
GZIPCompressorOutputStream (OutputStream* destStream, GZIPCompressorOutputStream (OutputStream* destStream,
int compressionLevel = 0,
int compressionLevel = -1,
bool deleteDestStreamWhenDestroyed = false, bool deleteDestStreamWhenDestroyed = false,
int windowBits = 0); int windowBits = 0);


+ 1
- 0
source/modules/juce_gui_basics/widgets/juce_TextEditor.cpp View File

@@ -1084,6 +1084,7 @@ void TextEditor::colourChanged()
void TextEditor::lookAndFeelChanged() void TextEditor::lookAndFeelChanged()
{ {
caret = nullptr;
recreateCaret(); recreateCaret();
repaint(); repaint();
} }


Loading…
Cancel
Save