From f4c1a8e8eff0eb1038226d08f426748c235b4c8b Mon Sep 17 00:00:00 2001 From: Josh Coalson Date: Thu, 27 Jan 2005 03:55:35 +0000 Subject: [PATCH] fixes for compiling with SunPro --- include/FLAC++/decoder.h | 6 +++--- include/FLAC++/encoder.h | 6 +++--- include/OggFLAC++/decoder.h | 6 +++--- include/OggFLAC++/encoder.h | 6 +++--- src/libFLAC++/file_encoder.cpp | 4 ++-- src/libFLAC++/seekable_stream_encoder.cpp | 4 ++-- src/libFLAC++/stream_encoder.cpp | 4 ++-- 7 files changed, 18 insertions(+), 18 deletions(-) diff --git a/include/FLAC++/decoder.h b/include/FLAC++/decoder.h index 872c420c..ae5fcfc0 100644 --- a/include/FLAC++/decoder.h +++ b/include/FLAC++/decoder.h @@ -141,7 +141,7 @@ namespace FLAC { virtual void metadata_callback(const ::FLAC__StreamMetadata *metadata) = 0; virtual void error_callback(::FLAC__StreamDecoderErrorStatus status) = 0; -#if (defined _MSC_VER) || (defined __GNUG__ && (__GNUG__ < 2 || (__GNUG__ == 2 && __GNUC_MINOR__ < 96))) +#if (defined _MSC_VER) || (defined __GNUG__ && (__GNUG__ < 2 || (__GNUG__ == 2 && __GNUC_MINOR__ < 96))) || (defined __SUNPRO_CC) // lame hack: some MSVC/GCC versions can't see a protected decoder_ from nested State::resolved_as_cstring() friend State; #endif @@ -236,7 +236,7 @@ namespace FLAC { virtual void metadata_callback(const ::FLAC__StreamMetadata *metadata) = 0; virtual void error_callback(::FLAC__StreamDecoderErrorStatus status) = 0; -#if (defined _MSC_VER) || (defined __GNUG__ && (__GNUG__ < 2 || (__GNUG__ == 2 && __GNUC_MINOR__ < 96))) +#if (defined _MSC_VER) || (defined __GNUG__ && (__GNUG__ < 2 || (__GNUG__ == 2 && __GNUC_MINOR__ < 96))) || (defined __SUNPRO_CC) // lame hack: some MSVC/GCC versions can't see a protected decoder_ from nested State::resolved_as_cstring() friend State; #endif @@ -329,7 +329,7 @@ namespace FLAC { virtual void metadata_callback(const ::FLAC__StreamMetadata *metadata) = 0; virtual void error_callback(::FLAC__StreamDecoderErrorStatus status) = 0; -#if (defined _MSC_VER) || (defined __GNUG__ && (__GNUG__ < 2 || (__GNUG__ == 2 && __GNUC_MINOR__ < 96))) +#if (defined _MSC_VER) || (defined __GNUG__ && (__GNUG__ < 2 || (__GNUG__ == 2 && __GNUC_MINOR__ < 96))) || (defined __SUNPRO_CC) // lame hack: some MSVC/GCC versions can't see a protected decoder_ from nested State::resolved_as_cstring() friend State; #endif diff --git a/include/FLAC++/encoder.h b/include/FLAC++/encoder.h index 7f639141..3b930bfb 100644 --- a/include/FLAC++/encoder.h +++ b/include/FLAC++/encoder.h @@ -159,7 +159,7 @@ namespace FLAC { virtual ::FLAC__StreamEncoderWriteStatus write_callback(const FLAC__byte buffer[], unsigned bytes, unsigned samples, unsigned current_frame) = 0; virtual void metadata_callback(const ::FLAC__StreamMetadata *metadata) = 0; -#if (defined _MSC_VER) || (defined __GNUG__ && (__GNUG__ < 2 || (__GNUG__ == 2 && __GNUC_MINOR__ < 96))) +#if (defined _MSC_VER) || (defined __GNUG__ && (__GNUG__ < 2 || (__GNUG__ == 2 && __GNUC_MINOR__ < 96))) || (defined __SUNPRO_CC) // lame hack: some MSVC/GCC versions can't see a protected encoder_ from nested State::resolved_as_cstring() friend State; #endif @@ -259,7 +259,7 @@ namespace FLAC { virtual ::FLAC__SeekableStreamEncoderTellStatus tell_callback(FLAC__uint64 *absolute_byte_offset) = 0; virtual ::FLAC__StreamEncoderWriteStatus write_callback(const FLAC__byte buffer[], unsigned bytes, unsigned samples, unsigned current_frame) = 0; -#if (defined _MSC_VER) || (defined __GNUG__ && (__GNUG__ < 2 || (__GNUG__ == 2 && __GNUC_MINOR__ < 96))) +#if (defined _MSC_VER) || (defined __GNUG__ && (__GNUG__ < 2 || (__GNUG__ == 2 && __GNUC_MINOR__ < 96))) || (defined __SUNPRO_CC) // lame hack: some MSVC/GCC versions can't see a protected encoder_ from nested State::resolved_as_cstring() friend State; #endif @@ -360,7 +360,7 @@ namespace FLAC { protected: virtual void progress_callback(FLAC__uint64 bytes_written, FLAC__uint64 samples_written, unsigned frames_written, unsigned total_frames_estimate); -#if (defined _MSC_VER) || (defined __GNUG__ && (__GNUG__ < 2 || (__GNUG__ == 2 && __GNUC_MINOR__ < 96))) +#if (defined _MSC_VER) || (defined __GNUG__ && (__GNUG__ < 2 || (__GNUG__ == 2 && __GNUC_MINOR__ < 96))) || (defined __SUNPRO_CC) // lame hack: some MSVC/GCC versions can't see a protected encoder_ from nested State::resolved_as_cstring() friend State; #endif diff --git a/include/OggFLAC++/decoder.h b/include/OggFLAC++/decoder.h index be3174aa..953daf60 100644 --- a/include/OggFLAC++/decoder.h +++ b/include/OggFLAC++/decoder.h @@ -144,7 +144,7 @@ namespace OggFLAC { virtual void metadata_callback(const ::FLAC__StreamMetadata *metadata) = 0; virtual void error_callback(::FLAC__StreamDecoderErrorStatus status) = 0; -#if (defined _MSC_VER) || (defined __GNUG__ && (__GNUG__ < 2 || (__GNUG__ == 2 && __GNUC_MINOR__ < 96))) +#if (defined _MSC_VER) || (defined __GNUG__ && (__GNUG__ < 2 || (__GNUG__ == 2 && __GNUC_MINOR__ < 96))) || (defined __SUNPRO_CC) // lame hack: some MSVC/GCC versions can't see a protected decoder_ from nested State::resolved_as_cstring() friend State; #endif @@ -240,7 +240,7 @@ namespace OggFLAC { virtual void metadata_callback(const ::FLAC__StreamMetadata *metadata) = 0; virtual void error_callback(::FLAC__StreamDecoderErrorStatus status) = 0; -#if (defined _MSC_VER) || (defined __GNUG__ && (__GNUG__ < 2 || (__GNUG__ == 2 && __GNUC_MINOR__ < 96))) +#if (defined _MSC_VER) || (defined __GNUG__ && (__GNUG__ < 2 || (__GNUG__ == 2 && __GNUC_MINOR__ < 96))) || (defined __SUNPRO_CC) // lame hack: some MSVC/GCC versions can't see a protected decoder_ from nested State::resolved_as_cstring() friend State; #endif @@ -334,7 +334,7 @@ namespace OggFLAC { virtual void metadata_callback(const ::FLAC__StreamMetadata *metadata) = 0; virtual void error_callback(::FLAC__StreamDecoderErrorStatus status) = 0; -#if (defined _MSC_VER) || (defined __GNUG__ && (__GNUG__ < 2 || (__GNUG__ == 2 && __GNUC_MINOR__ < 96))) +#if (defined _MSC_VER) || (defined __GNUG__ && (__GNUG__ < 2 || (__GNUG__ == 2 && __GNUC_MINOR__ < 96))) || (defined __SUNPRO_CC) // lame hack: some MSVC/GCC versions can't see a protected decoder_ from nested State::resolved_as_cstring() friend State; #endif diff --git a/include/OggFLAC++/encoder.h b/include/OggFLAC++/encoder.h index 8aa9abcd..7967888d 100644 --- a/include/OggFLAC++/encoder.h +++ b/include/OggFLAC++/encoder.h @@ -162,7 +162,7 @@ namespace OggFLAC { virtual ::FLAC__StreamEncoderWriteStatus write_callback(const FLAC__byte buffer[], unsigned bytes, unsigned samples, unsigned current_frame) = 0; virtual void metadata_callback(const ::FLAC__StreamMetadata *metadata) = 0; -#if (defined _MSC_VER) || (defined __GNUG__ && (__GNUG__ < 2 || (__GNUG__ == 2 && __GNUC_MINOR__ < 96))) +#if (defined _MSC_VER) || (defined __GNUG__ && (__GNUG__ < 2 || (__GNUG__ == 2 && __GNUC_MINOR__ < 96))) || (defined __SUNPRO_CC) // lame hack: some MSVC/GCC versions can't see a protected encoder_ from nested State::resolved_as_cstring() friend State; #endif @@ -263,7 +263,7 @@ namespace OggFLAC { virtual ::FLAC__SeekableStreamEncoderTellStatus tell_callback(FLAC__uint64 *absolute_byte_offset) = 0; virtual ::FLAC__StreamEncoderWriteStatus write_callback(const FLAC__byte buffer[], unsigned bytes, unsigned samples, unsigned current_frame) = 0; -#if (defined _MSC_VER) || (defined __GNUG__ && (__GNUG__ < 2 || (__GNUG__ == 2 && __GNUC_MINOR__ < 96))) +#if (defined _MSC_VER) || (defined __GNUG__ && (__GNUG__ < 2 || (__GNUG__ == 2 && __GNUC_MINOR__ < 96))) || (defined __SUNPRO_CC) // lame hack: some MSVC/GCC versions can't see a protected encoder_ from nested State::resolved_as_cstring() friend State; #endif @@ -365,7 +365,7 @@ namespace OggFLAC { protected: virtual void progress_callback(FLAC__uint64 bytes_written, FLAC__uint64 samples_written, unsigned frames_written, unsigned total_frames_estimate); -#if (defined _MSC_VER) || (defined __GNUG__ && (__GNUG__ < 2 || (__GNUG__ == 2 && __GNUC_MINOR__ < 96))) +#if (defined _MSC_VER) || (defined __GNUG__ && (__GNUG__ < 2 || (__GNUG__ == 2 && __GNUC_MINOR__ < 96))) || (defined __SUNPRO_CC) // lame hack: some MSVC/GCC versions can't see a protected encoder_ from nested State::resolved_as_cstring() friend State; #endif diff --git a/src/libFLAC++/file_encoder.cpp b/src/libFLAC++/file_encoder.cpp index 706dc68b..0de22822 100644 --- a/src/libFLAC++/file_encoder.cpp +++ b/src/libFLAC++/file_encoder.cpp @@ -168,7 +168,7 @@ namespace FLAC { bool File::set_metadata(FLAC::Metadata::Prototype **metadata, unsigned num_blocks) { FLAC__ASSERT(is_valid()); -#ifdef _MSC_VER +#if (defined _MSC_VER) || (defined __SUNPRO_CC) // MSVC++ can't handle: // ::FLAC__StreamMetadata *m[num_blocks]; // so we do this ugly workaround @@ -180,7 +180,7 @@ namespace FLAC { // we can get away with this since we know the encoder will only correct the is_last flags m[i] = const_cast< ::FLAC__StreamMetadata*>((::FLAC__StreamMetadata*)metadata[i]); } -#ifdef _MSC_VER +#if (defined _MSC_VER) || (defined __SUNPRO_CC) // complete the hack const bool ok = (bool)::FLAC__file_encoder_set_metadata(encoder_, m, num_blocks); delete [] m; diff --git a/src/libFLAC++/seekable_stream_encoder.cpp b/src/libFLAC++/seekable_stream_encoder.cpp index f7f2975c..6ea25084 100644 --- a/src/libFLAC++/seekable_stream_encoder.cpp +++ b/src/libFLAC++/seekable_stream_encoder.cpp @@ -168,7 +168,7 @@ namespace FLAC { bool SeekableStream::set_metadata(FLAC::Metadata::Prototype **metadata, unsigned num_blocks) { FLAC__ASSERT(is_valid()); -#ifdef _MSC_VER +#if (defined _MSC_VER) || (defined __SUNPRO_CC) // MSVC++ can't handle: // ::FLAC__StreamMetadata *m[num_blocks]; // so we do this ugly workaround @@ -180,7 +180,7 @@ namespace FLAC { // we can get away with this since we know the encoder will only correct the is_last flags m[i] = const_cast< ::FLAC__StreamMetadata*>((::FLAC__StreamMetadata*)metadata[i]); } -#ifdef _MSC_VER +#if (defined _MSC_VER) || (defined __SUNPRO_CC) // complete the hack const bool ok = (bool)::FLAC__seekable_stream_encoder_set_metadata(encoder_, m, num_blocks); delete [] m; diff --git a/src/libFLAC++/stream_encoder.cpp b/src/libFLAC++/stream_encoder.cpp index 6d8fd713..2c7be4e6 100644 --- a/src/libFLAC++/stream_encoder.cpp +++ b/src/libFLAC++/stream_encoder.cpp @@ -169,7 +169,7 @@ namespace FLAC { bool Stream::set_metadata(FLAC::Metadata::Prototype **metadata, unsigned num_blocks) { FLAC__ASSERT(is_valid()); -#ifdef _MSC_VER +#if (defined _MSC_VER) || (defined __SUNPRO_CC) // MSVC++ can't handle: // ::FLAC__StreamMetadata *m[num_blocks]; // so we do this ugly workaround @@ -181,7 +181,7 @@ namespace FLAC { // we can get away with this since we know the encoder will only correct the is_last flags m[i] = const_cast< ::FLAC__StreamMetadata*>((::FLAC__StreamMetadata*)metadata[i]); } -#ifdef _MSC_VER +#if (defined _MSC_VER) || (defined __SUNPRO_CC) // complete the hack const bool ok = (bool)::FLAC__stream_encoder_set_metadata(encoder_, m, num_blocks); delete [] m;