The attached patch is needed to make flac build on Solaris. Can some/all of these changes go upstream?

Brian
--- flac-1.1.3/src/plugin_common/tags.c.orig	2006-11-30 15:58:34.067469000 +0000
+++ flac-1.1.3/src/plugin_common/tags.c	2006-11-30 16:00:10.958487000 +0000
@@ -29,7 +29,7 @@
 #include "FLAC/metadata.h"
 
 
-static __inline unsigned local__wide_strlen(const FLAC__uint16 *s)
+static inline unsigned local__wide_strlen(const FLAC__uint16 *s)
 {
 	unsigned n = 0;
 	while(*s++)
@@ -43,7 +43,7 @@
  * and a more clear explanation at the end of this section:
  *   http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
  */
-static __inline unsigned local__utf8len(const FLAC__byte *utf8)
+static inline unsigned local__utf8len(const FLAC__byte *utf8)
 {
 	FLAC__ASSERT(0 != utf8);
 	if ((utf8[0] & 0x80) == 0) {
@@ -85,7 +85,7 @@
 }
 
 
-static __inline unsigned local__utf8_to_ucs2(const FLAC__byte *utf8, FLAC__uint16 *ucs2)
+static inline unsigned local__utf8_to_ucs2(const FLAC__byte *utf8, FLAC__uint16 *ucs2)
 {
 	const unsigned len = local__utf8len(utf8);
 
@@ -140,7 +140,7 @@
 	return out;
 }
 
-static __inline unsigned local__ucs2len(FLAC__uint16 ucs2)
+static inline unsigned local__ucs2len(FLAC__uint16 ucs2)
 {
 	if (ucs2 < 0x0080)
 		return 1;
@@ -150,7 +150,7 @@
 		return 3;
 }
 
-static __inline unsigned local__ucs2_to_utf8(FLAC__uint16 ucs2, FLAC__byte *utf8)
+static inline unsigned local__ucs2_to_utf8(FLAC__uint16 ucs2, FLAC__byte *utf8)
 {
 	if (ucs2 < 0x080) {
 		utf8[0] = (FLAC__byte)ucs2;
+++ flac-1.1.3/src/share/replaygain_analysis/replaygain_analysis.c	2006-11-30 16:05:05.804777000 +0000
@@ -122,7 +122,14 @@
  * sampleWindow calculation in ResetSampleFrequency(), and was causing
  * buffer overflows for 48kHz analysis, hence the +1.
  */
+#ifndef __sun
 #define MAX_SAMPLES_PER_WINDOW  (size_t) (MAX_SAMP_FREQ * RMS_WINDOW_TIME + 1.)   /* max. Samples per Time slice */
+#else
+ /* Different #define for Solaris Forte compiler because it
+    doesn't like to multiply floats when declaring a variable. */
+#define MAX_SAMPLES_PER_WINDOW  (size_t) (2401)
+#define UINT32_T_FORTE 12000.0 /* Used in Unit32_t code below. */
+#endif
 #define PINK_REF                64.82 /* 298640883795 */                          /* calibration value */
 
 static Float_t          linprebuf [MAX_ORDER * 2];
@@ -142,8 +149,13 @@
 static double           lsum;
 static double           rsum;
 static int              freqindex;
+#ifndef __sun
 static Uint32_t  A [(size_t)(STEPS_per_dB * MAX_dB)];
 static Uint32_t  B [(size_t)(STEPS_per_dB * MAX_dB)];
+#else
+static Uint32_t  A [(size_t)(UINT32_T_FORTE)];
+static Uint32_t  B [(size_t)(UINT32_T_FORTE)];
+#endif
 
 /* for each filter:
    [0] 48 kHz, [1] 44.1 kHz, [2] 32 kHz, [3] 24 kHz, [4] 22050 Hz, [5] 16 kHz, [6] 12 kHz, [7] is 11025 Hz, [8] 8 kHz */
--- flac-1.1.3/src/libFLAC/format.c.orig	2006-12-02 19:57:22.519801600 +0000
+++ flac-1.1.3/src/libFLAC/format.c	2006-12-02 19:57:40.139113400 +0000
@@ -294,7 +294,7 @@
  * and a more clear explanation at the end of this section:
  *   http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
  */
-static __inline unsigned utf8len_(const FLAC__byte *utf8)
+static inline unsigned utf8len_(const FLAC__byte *utf8)
 {
 	FLAC__ASSERT(0 != utf8);
 	if ((utf8[0] & 0x80) == 0) {
_______________________________________________
Flac-dev mailing list
Flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev

Reply via email to