gcc-6: don't ship info pages
[unleashed-userland.git] / components / library / id3lib / patches / 03-gcc4.patch
blob93bd04e8c1bce4fb03ad64c5be1a327f8345ae88
1 --- id3lib-3.8.3.orig/configure.in Fri Sep 25 17:57:49 2009
2 +++ id3lib-3.8.3/configure.in Fri Sep 25 18:03:13 2009
3 @@ -222,12 +222,11 @@
4 AC_LANG_CPLUSPLUS
5 AC_CHECK_HEADERS(libcw/sys.h)
6 AC_CHECK_HEADERS(cctype climits cstdio cstdlib bitset cstring)
7 -AC_CHECK_HEADERS(fstream iostream iomanip vector \
8 +AC_CHECK_HEADERS(fstream iostream vector \
9 ,,AC_MSG_ERROR([Missing a vital header file for id3lib - download them here: http://gcc.gnu.org/libstdc++/ or better - compile a newer compiler like gcc3.x])
11 AC_CHECK_HEADERS( \
12 string \
13 - iomanip.h \
14 ,,AC_MSG_ERROR([Missing a vital header file for id3lib])
17 --- id3lib3.8.3-3.8.3.orig/include/id3/writers.h
18 +++ id3lib3.8.3-3.8.3/include/id3/writers.h
19 @@ -30,7 +30,7 @@
21 #include "id3/writer.h"
22 #include "id3/id3lib_streams.h"
23 -//#include <string.h>
24 +#include <cstring>
26 class ID3_CPP_EXPORT ID3_OStreamWriter : public ID3_Writer
28 --- id3lib3.8.3-3.8.3.orig/include/id3/id3lib_strings.h
29 +++ id3lib3.8.3-3.8.3/include/id3/id3lib_strings.h
30 @@ -30,6 +30,7 @@
31 #define _ID3LIB_STRINGS_H_
33 #include <string>
34 +#include <cstring>
36 #if (defined(__GNUC__) && (__GNUC__ >= 3) || (defined(_MSC_VER) && _MSC_VER > 1000))
37 namespace std
38 --- id3lib3.8.3-3.8.3.orig/src/io_helpers.cpp
39 +++ id3lib3.8.3-3.8.3/src/io_helpers.cpp
40 @@ -363,11 +363,22 @@
41 // Write the BOM: 0xFEFF
42 unicode_t BOM = 0xFEFF;
43 writer.writeChars((const unsigned char*) &BOM, 2);
44 + // Patch from Spoon : 2004-08-25 14:17
45 + // http://sourceforge.net/tracker/index.php?func=detail&aid=1016290&group_id=979&atid=300979
46 + // Wrong code
47 + //for (size_t i = 0; i < size; i += 2)
48 + //{
49 + // unicode_t ch = (data[i] << 8) | data[i+1];
50 + // writer.writeChars((const unsigned char*) &ch, 2);
51 + //}
52 + // Right code
53 + unsigned char *pdata = (unsigned char *) data.c_str();
54 for (size_t i = 0; i < size; i += 2)
56 - unicode_t ch = (data[i] << 8) | data[i+1];
57 + unicode_t ch = (pdata[i] << 8) | pdata[i+1];
58 writer.writeChars((const unsigned char*) &ch, 2);
60 + // End patch
62 return writer.getCur() - beg;
64 --- id3lib3.8.3-3.8.3.orig/src/tag_file.cpp
65 +++ id3lib3.8.3-3.8.3/src/tag_file.cpp
66 @@ -242,8 +242,8 @@
67 strcpy(sTempFile, filename.c_str());
68 strcat(sTempFile, sTmpSuffix.c_str());
70 -#if ((defined(__GNUC__) && __GNUC__ >= 3 ) || !defined(HAVE_MKSTEMP))
71 - // This section is for Windows folk && gcc 3.x folk
72 +#if !defined(HAVE_MKSTEMP)
73 + // This section is for Windows folk
74 fstream tmpOut;
75 createFile(sTempFile, tmpOut);
77 @@ -257,7 +257,7 @@
78 tmpOut.write((char *)tmpBuffer, nBytes);
81 -#else //((defined(__GNUC__) && __GNUC__ >= 3 ) || !defined(HAVE_MKSTEMP))
82 +#else //!defined(HAVE_MKSTEMP)
84 // else we gotta make a temp file, copy the tag into it, copy the
85 // rest of the old file after the tag, delete the old file, rename
86 @@ -270,7 +270,7 @@
87 //ID3_THROW_DESC(ID3E_NoFile, "couldn't open temp file");
90 - ofstream tmpOut(fd);
91 + ofstream tmpOut(sTempFile);
92 if (!tmpOut)
94 tmpOut.close();
95 @@ -292,7 +292,7 @@
97 close(fd); //closes the file
99 -#endif ////((defined(__GNUC__) && __GNUC__ >= 3 ) || !defined(HAVE_MKSTEMP))
100 +#endif ////!defined(HAVE_MKSTEMP)
102 tmpOut.close();
103 file.close();
104 --- id3lib3.8.3-3.8.3.orig/examples/demo_convert.cpp
105 +++ id3lib3.8.3-3.8.3/examples/demo_convert.cpp
106 @@ -84,7 +84,7 @@
110 -int main( unsigned int argc, char * const argv[])
111 +int main(int argc, char * const argv[])
113 flags_t ulFlag = ID3TT_ALL;
114 gengetopt_args_info args;
115 --- id3lib3.8.3-3.8.3.orig/examples/demo_copy.cpp
116 +++ id3lib3.8.3-3.8.3/examples/demo_copy.cpp
117 @@ -81,7 +81,7 @@
121 -int main( unsigned int argc, char * const argv[])
122 +int main(int argc, char * const argv[])
124 int ulFlag = ID3TT_ID3;
125 ID3D_INIT_DOUT();
126 --- id3lib3.8.3-3.8.3.orig/examples/demo_info.cpp
127 +++ id3lib3.8.3-3.8.3/examples/demo_info.cpp
128 @@ -309,7 +309,7 @@
130 #define DEBUG
132 -int main( unsigned int argc, char * const argv[])
133 +int main(int argc, char * const argv[])
135 ID3D_INIT_DOUT();
137 --- id3lib3.8.3-3.8.3.orig/examples/demo_tag.cpp
138 +++ id3lib3.8.3-3.8.3/examples/demo_tag.cpp
139 @@ -46,7 +46,7 @@
140 os << "v2";
143 -int main( unsigned int argc, char * const argv[])
144 +int main(int argc, char * const argv[])
146 int ulFlag = ID3TT_ID3;
147 ID3D_INIT_DOUT();