Date: Mon, 15 Mar 2004 01:49:18 -0500 (EST) From: Chris BeHanna <chris@behanna.org> To: FreeBSD-gnats-submit@FreeBSD.org Subject: ports/64284: [PATCH] Fix audio/id3lib compilation with g++3.4 Message-ID: <200403150649.i2F6nInw085637@topperwein.pennasoft.com> Resent-Message-ID: <200403150650.i2F6oMJl074141@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 64284 >Category: ports >Synopsis: [PATCH] Fix audio/id3lib compilation with g++3.4 >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sun Mar 14 22:50:22 PST 2004 >Closed-Date: >Last-Modified: >Originator: Chris BeHanna >Release: FreeBSD 4.9-STABLE i386 >Organization: Western Pennsylvania Pizza Disposal Unit >Environment: System: FreeBSD topperwein.pennasoft.com 4.9-STABLE FreeBSD 4.9-STABLE #1: Fri Feb 20 19:56:51 EST 2004 behanna@topperwein.pennasoft.com:/raid0/stable/usr/obj/raid5/4stable/src/sys/TOPPERWEIN i386 >Description: When building audio/id3lib with g++3.4, the build fails with a complaint at line 60 of include/id3/readers.h that the conversion from std::streampos to uint32 fails. This port (unwisely IMHO) goes to great lengths to have private definitions of fixed-width integers and of several STL types, pos_type being one of them. It is pos_type (defined in include/id3/reader.h) that causes the problem. audio/id3lib incorrectly typedefs it from uint32, but STL typedefs it from std::streampos, which is in turn typedef'd from std::fpos, which is a class, not a simple type. >How-To-Repeat: On FreeBSD 4.9, attempt to build audio/id3lib with lang/gcc33. >Fix: I use the following patch, which I placed in audio/id3lib/patch-reader.h. I will also send it along upstream, and to the port maintainer. --- include/id3/reader.h.orig Sat Mar 1 19:23:00 2003 +++ include/id3/reader.h Mon Mar 15 01:37:19 2004 @@ -28,6 +28,10 @@ #ifndef _ID3LIB_READER_H_ #define _ID3LIB_READER_H_ +#if defined(__GNUC__) && (__GNUC__ == 3) && (__GNUC_MINOR__ >= 4) +#include <string> // for std::streampos and pos_type +#endif + #include "id3/globals.h" //has <stdlib.h> "id3/sized_types.h" class ID3_CPP_EXPORT ID3_Reader @@ -35,7 +39,11 @@ public: typedef uint32 size_type; typedef uint8 char_type; +#if defined(__GNUC__) && (__GNUC__ == 3) && (__GNUC_MINOR__ >= 4) + /* pos_type is a typedef of std::streampos in g++ 3.4 */ +#else typedef uint32 pos_type; +#endif typedef int32 off_type; typedef int16 int_type; static const int_type END_OF_READER; >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200403150649.i2F6nInw085637>