Browse Source

VC2011 compiler tweaks. ReferenceCountedArray fix.

tags/2021-05-28
jules 13 years ago
parent
commit
22c72de736
4 changed files with 31 additions and 5 deletions
  1. +1
    -1
      modules/juce_audio_formats/codecs/flac/libFLAC/stream_decoder.c
  2. +1
    -1
      modules/juce_audio_formats/codecs/flac/libFLAC/stream_encoder.c
  3. +24
    -2
      modules/juce_core/containers/juce_ReferenceCountedArray.h
  4. +5
    -1
      modules/juce_core/system/juce_PlatformDefs.h

+ 1
- 1
modules/juce_audio_formats/codecs/flac/libFLAC/stream_decoder.c View File

@@ -47,7 +47,7 @@
#include <sys/stat.h> /* for stat() */
#include <sys/types.h> /* for off_t */
#if defined _MSC_VER || defined __BORLANDC__ || defined __MINGW32__
#if _MSC_VER <= 1600 || defined __BORLANDC__ /* @@@ [2G limit] */
#if _MSC_VER <= 1700 || defined __BORLANDC__ /* @@@ [2G limit] */
#define fseeko fseek
#define ftello ftell
#endif


+ 1
- 1
modules/juce_audio_formats/codecs/flac/libFLAC/stream_encoder.c View File

@@ -47,7 +47,7 @@
#include <string.h> /* for memcpy() */
#include <sys/types.h> /* for off_t */
#if defined _MSC_VER || defined __BORLANDC__ || defined __MINGW32__
#if _MSC_VER <= 1600 || defined __BORLANDC__ /* @@@ [2G limit] */
#if _MSC_VER <= 1700 || defined __BORLANDC__ /* @@@ [2G limit] */
#define fseeko fseek
#define ftello ftell
#endif


+ 24
- 2
modules/juce_core/containers/juce_ReferenceCountedArray.h View File

@@ -61,8 +61,7 @@ public:
}
/** Creates a copy of another array */
template <class OtherObjectClass>
ReferenceCountedArray (const ReferenceCountedArray<OtherObjectClass, TypeOfCriticalSectionToUse>& other) noexcept
ReferenceCountedArray (const ReferenceCountedArray& other) noexcept
{
const ScopedLockType lock (other.getLock());
numUsed = other.size();
@@ -74,8 +73,31 @@ public:
data.elements[i]->incReferenceCount();
}
/** Creates a copy of another array */
template <class OtherObjectClass, class OtherCriticalSection>
ReferenceCountedArray (const ReferenceCountedArray<OtherObjectClass, OtherCriticalSection>& other) noexcept
{
const typename ReferenceCountedArray<OtherObjectClass, OtherCriticalSection>::ScopedLockType lock (other.getLock());
numUsed = other.size();
data.setAllocatedSize (numUsed);
memcpy (data.elements, other.getRawDataPointer(), numUsed * sizeof (ObjectClass*));
for (int i = numUsed; --i >= 0;)
if (data.elements[i] != nullptr)
data.elements[i]->incReferenceCount();
}
/** Copies another array into this one.
Any existing objects in this array will first be released.
*/
ReferenceCountedArray& operator= (const ReferenceCountedArray& other) noexcept
{
ReferenceCountedArray otherCopy (other);
swapWithArray (otherCopy);
return *this;
}
/** Copies another array into this one.
Any existing objects in this array will first be released.
*/
template <class OtherObjectClass>


+ 5
- 1
modules/juce_core/system/juce_PlatformDefs.h View File

@@ -298,7 +298,11 @@ namespace juce
#endif
#if defined (_MSC_VER) && _MSC_VER >= 1600
#define JUCE_COMPILER_SUPPORTS_NOEXCEPT 0
#if _MSC_VER >= 1700
#define JUCE_COMPILER_SUPPORTS_NOEXCEPT 1
#else
#define JUCE_COMPILER_SUPPORTS_NOEXCEPT 0
#endif
#define JUCE_COMPILER_SUPPORTS_NULLPTR 1
#define JUCE_COMPILER_SUPPORTS_MOVE_SEMANTICS 1
#endif


Loading…
Cancel
Save