patch: support for borland c++ compile (SF#1599018: http://sourceforge.net/tracker...
authorJosh Coalson <jcoalson@users.sourceforce.net>
Tue, 21 Nov 2006 01:51:58 +0000 (01:51 +0000)
committerJosh Coalson <jcoalson@users.sourceforce.net>
Tue, 21 Nov 2006 01:51:58 +0000 (01:51 +0000)
include/FLAC++/decoder.h
include/FLAC++/encoder.h
src/libFLAC++/stream_encoder.cpp
src/libFLAC/metadata_iterators.c
src/libFLAC/metadata_object.c
src/libFLAC/stream_decoder.c
src/libFLAC/stream_encoder.c

index 78730db..eb1a416 100644 (file)
@@ -179,7 +179,7 @@ namespace FLAC {
                        /// see FLAC__StreamDecoderErrorCallback
                        virtual void error_callback(::FLAC__StreamDecoderErrorStatus status) = 0;
 
-#if (defined _MSC_VER) || (defined __GNUG__ && (__GNUG__ < 2 || (__GNUG__ == 2 && __GNUC_MINOR__ < 96))) || (defined __SUNPRO_CC)
+#if (defined _MSC_VER) || (defined __BORLANDC__) || (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
index 0752ccd..924e210 100644 (file)
@@ -192,7 +192,7 @@ namespace FLAC {
                        /// See FLAC__StreamEncoderTellCallback
                        virtual void metadata_callback(const ::FLAC__StreamMetadata *metadata);
 
-#if (defined _MSC_VER) || (defined __GNUG__ && (__GNUG__ < 2 || (__GNUG__ == 2 && __GNUC_MINOR__ < 96))) || (defined __SUNPRO_CC)
+#if (defined _MSC_VER) || (defined __BORLANDC__) || (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
index bd7ff23..c78d71f 100644 (file)
@@ -193,7 +193,7 @@ namespace FLAC {
                bool Stream::set_metadata(FLAC::Metadata::Prototype **metadata, unsigned num_blocks)
                {
                        FLAC__ASSERT(is_valid());
-#if (defined _MSC_VER) || (defined __SUNPRO_CC)
+#if (defined _MSC_VER) || (defined __BORLANDC__) || (defined __SUNPRO_CC)
                        // MSVC++ can't handle:
                        // ::FLAC__StreamMetadata *m[num_blocks];
                        // so we do this ugly workaround
@@ -205,7 +205,7 @@ namespace FLAC {
                                // we can get away with the const_cast since we know the encoder will only correct the is_last flags
                                m[i] = const_cast< ::FLAC__StreamMetadata*>((const ::FLAC__StreamMetadata*)metadata[i]);
                        }
-#if (defined _MSC_VER) || (defined __SUNPRO_CC)
+#if (defined _MSC_VER) || (defined __BORLANDC__) || (defined __SUNPRO_CC)
                        // complete the hack
                        const bool ok = (bool)::FLAC__stream_encoder_set_metadata(encoder_, m, num_blocks);
                        delete [] m;
index 38f75bb..225d042 100644 (file)
 #include <stdlib.h>
 #include <string.h>
 
-#if defined _MSC_VER || defined __MINGW32__
+#if defined _MSC_VER || defined __BORLANDC__ || defined __MINGW32__
+#if defined __BORLANDC__
+#include <utime.h> /* for utime() */
+#else
 #include <sys/utime.h> /* for utime() */
+#endif
 #include <io.h> /* for chmod() */
 #include <sys/types.h> /* for off_t */
-#if _MSC_VER <= 1200 /* @@@ [2G limit] */
+#if _MSC_VER <= 1200 || defined __BORLANDC__ /* @@@ [2G limit] */
 #define fseeko fseek
 #define ftello ftell
 #endif
index 1726787..a8c6f50 100644 (file)
@@ -1353,7 +1353,7 @@ FLAC_API FLAC__bool FLAC__metadata_object_vorbiscomment_entry_matches(const FLAC
        FLAC__ASSERT(0 != entry.entry && entry.length > 0);
        {
                const FLAC__byte *eq = (FLAC__byte*)memchr(entry.entry, '=', entry.length);
-#if defined _MSC_VER || defined __MINGW32__ || defined __EMX__
+#if defined _MSC_VER || defined __BORLANDC__ || defined __MINGW32__ || defined __EMX__
 #define FLAC__STRNCASECMP strnicmp
 #else
 #define FLAC__STRNCASECMP strncasecmp
index 7c4e363..bcf63f6 100644 (file)
@@ -46,8 +46,8 @@
 #include <string.h> /* for memset/memcpy() */
 #include <sys/stat.h> /* for stat() */
 #include <sys/types.h> /* for off_t */
-#if defined _MSC_VER || defined __MINGW32__
-#if _MSC_VER <= 1200 /* @@@ [2G limit] */
+#if defined _MSC_VER || defined __BORLANDC__ || defined __MINGW32__
+#if _MSC_VER <= 1200 || defined __BORLANDC__ /* @@@ [2G limit] */
 #define fseeko fseek
 #define ftello ftell
 #endif
index 2246b82..968ae2b 100644 (file)
@@ -46,8 +46,8 @@
 #include <stdlib.h> /* for malloc() */
 #include <string.h> /* for memcpy() */
 #include <sys/types.h> /* for off_t */
-#if defined _MSC_VER || defined __MINGW32__
-#if _MSC_VER <= 1200 /* @@@ [2G limit] */
+#if defined _MSC_VER || defined __BORLANDC__ || defined __MINGW32__
+#if _MSC_VER <= 1200 || defined __BORLANDC__ /* @@@ [2G limit] */
 #define fseeko fseek
 #define ftello ftell
 #endif