open-plc-utils: new package
[buildroot-gz.git] / package / libsidplay2 / 0001-sidplay2-libs-2.1.1.patch
blob3f7664407a14150adaddfe12f7735156963abbec
1 Various fixes to compile libsidplay2 with newer gcc compilers
3 Downloaded from
4 http://tsubasa.googlecode.com/svn/trunk/tsubasa/sidplay2-libs/sidplay2-libs-2.1.1.diff
6 Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
8 --- sidplay-libs-2.1.1.orig/Makefile.in
9 +++ sidplay-libs-2.1.1/Makefile.in
10 @@ -1,4 +1,4 @@
11 -# Makefile.in generated by automake 1.8.4 from Makefile.am.
12 +# Makefile.in generated by automake 1.8.5 from Makefile.am.
13 # @configure_input@
15 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
16 @@ -253,7 +253,7 @@
17 fi; \
18 list='$(SUBDIRS)'; for subdir in $$list; do \
19 if test "$$subdir" = .; then :; else \
20 - test -f $$subdir/TAGS && \
21 + test ! -f $$subdir/TAGS || \
22 tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
23 fi; \
24 done; \
25 @@ -264,7 +264,7 @@
26 $(AWK) ' { files[$$0] = 1; } \
27 END { for (i in files) print i; }'`; \
28 if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
29 - test -z "$$unique" && unique=$$empty_fix; \
30 + test -n "$$unique" || unique=$$empty_fix; \
31 $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
32 $$tags $$unique; \
34 --- sidplay-libs-2.1.1.orig/aclocal.m4
35 +++ sidplay-libs-2.1.1/aclocal.m4
36 @@ -1,4 +1,4 @@
37 -# generated automatically by aclocal 1.8.4 -*- Autoconf -*-
38 +# generated automatically by aclocal 1.8.5 -*- Autoconf -*-
40 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
41 # Free Software Foundation, Inc.
42 @@ -40,7 +40,7 @@
43 # Call AM_AUTOMAKE_VERSION so it can be traced.
44 # This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
45 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
46 - [AM_AUTOMAKE_VERSION([1.8.4])])
47 + [AM_AUTOMAKE_VERSION([1.8.5])])
49 # AM_AUX_DIR_EXPAND
51 --- sidplay-libs-2.1.1.orig/builders/Makefile.in
52 +++ sidplay-libs-2.1.1/builders/Makefile.in
53 @@ -1,4 +1,4 @@
54 -# Makefile.in generated by automake 1.8.4 from Makefile.am.
55 +# Makefile.in generated by automake 1.8.5 from Makefile.am.
56 # @configure_input@
58 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
59 @@ -130,9 +130,9 @@
60 exit 1;; \
61 esac; \
62 done; \
63 - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu builders/Makefile'; \
64 + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign builders/Makefile'; \
65 cd $(top_srcdir) && \
66 - $(AUTOMAKE) --gnu builders/Makefile
67 + $(AUTOMAKE) --foreign builders/Makefile
68 .PRECIOUS: Makefile
69 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
70 @case '$?' in \
71 @@ -234,7 +234,7 @@
72 fi; \
73 list='$(SUBDIRS)'; for subdir in $$list; do \
74 if test "$$subdir" = .; then :; else \
75 - test -f $$subdir/TAGS && \
76 + test ! -f $$subdir/TAGS || \
77 tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
78 fi; \
79 done; \
80 @@ -245,7 +245,7 @@
81 $(AWK) ' { files[$$0] = 1; } \
82 END { for (i in files) print i; }'`; \
83 if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
84 - test -z "$$unique" && unique=$$empty_fix; \
85 + test -n "$$unique" || unique=$$empty_fix; \
86 $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
87 $$tags $$unique; \
89 --- sidplay-libs-2.1.1.orig/builders/hardsid-builder/src/hardsid-builder.cpp
90 +++ sidplay-libs-2.1.1/builders/hardsid-builder/src/hardsid-builder.cpp
91 @@ -47,6 +47,7 @@
92 ***************************************************************************/
94 #include <stdio.h>
95 +#include <cstring>
96 #include "config.h"
98 #ifdef HAVE_EXCEPTIONS
99 --- sidplay-libs-2.1.1.orig/builders/resid-builder/src/resid-builder.cpp
100 +++ sidplay-libs-2.1.1/builders/resid-builder/src/resid-builder.cpp
101 @@ -37,6 +37,7 @@
102 ***************************************************************************/
104 #include <stdio.h>
105 +#include <cstring>
107 #include "config.h"
108 #ifdef HAVE_EXCEPTIONS
109 --- sidplay-libs-2.1.1.orig/builders/resid-builder/src/resid.cpp
110 +++ sidplay-libs-2.1.1/builders/resid-builder/src/resid.cpp
111 @@ -16,6 +16,7 @@
113 ***************************************************************************/
115 +#include <cstring>
116 #include "config.h"
118 #ifdef HAVE_EXCEPTIONS
119 --- sidplay-libs-2.1.1.orig/configure.ac
120 +++ sidplay-libs-2.1.1/configure.ac
121 @@ -2,7 +2,7 @@
123 #Variables
124 pwd=`pwd`
125 -builders='${libdir}'/sidplay/builders
126 +builders='${libdir}'/
127 ac_configure_args="$ac_configure_args --disable-library-checks"
129 AC_CONFIG_AUX_DIR(unix)
130 @@ -11,7 +11,7 @@
132 hardsid=false
133 case "$host" in
134 - *linux*) hardsid=true
135 + *linux*|*-k*bsd*-gnu) hardsid=true
137 esac
138 AM_CONDITIONAL(HARDSID, test x$hardsid = xtrue)
139 --- sidplay-libs-2.1.1.orig/libsidplay/include/sidplay/SmartPtr.h
140 +++ sidplay-libs-2.1.1/libsidplay/include/sidplay/SmartPtr.h
141 @@ -17,16 +17,16 @@
142 doFree = bufOwner;
143 if ( bufferLen >= 1 )
145 - pBufCurrent = ( bufBegin = buffer );
146 - bufEnd = bufBegin + bufferLen;
147 - bufLen = bufferLen;
148 - status = true;
149 + this->pBufCurrent = ( this->bufBegin = buffer );
150 + this->bufEnd = this->bufBegin + bufferLen;
151 + this->bufLen = bufferLen;
152 + this->status = true;
154 else
156 - pBufCurrent = ( bufBegin = ( bufEnd = 0 ));
157 - bufLen = 0;
158 - status = false;
159 + this->pBufCurrent = ( this->bufBegin = ( this->bufEnd = 0 ));
160 + this->bufLen = 0;
161 + this->status = false;
165 @@ -211,16 +211,16 @@
167 if ( bufferLen >= 1 )
169 - pBufCurrent = ( bufBegin = buffer );
170 - bufEnd = bufBegin + bufferLen;
171 - bufLen = bufferLen;
172 - status = true;
173 + this->pBufCurrent = ( this->bufBegin = buffer );
174 + this->bufEnd = this->bufBegin + bufferLen;
175 + this->bufLen = bufferLen;
176 + this->status = true;
178 else
180 - pBufCurrent = bufBegin = bufEnd = 0;
181 - bufLen = 0;
182 - status = false;
183 + this->pBufCurrent = this->bufBegin = this->bufEnd = 0;
184 + this->bufLen = 0;
185 + this->status = false;
189 --- sidplay-libs-2.1.1.orig/libsidplay/include/sidplay/sidendian.h
190 +++ sidplay-libs-2.1.1/libsidplay/include/sidplay/sidendian.h
191 @@ -16,6 +16,10 @@
192 ***************************************************************************/
193 /***************************************************************************
194 * $Log: sidendian.h,v $
195 + * Revision 1.6 2005/11/20 11:02:06 s_a_white
196 + * Work around for bug in gcc 4 (optimiser breaks if variable never has a
197 + * direct assignment).
199 * Revision 1.5 2001/07/03 22:44:13 s_a_white
200 * Added endian_16 to convert a 16 bit value to an array of 8s.
202 @@ -141,7 +145,7 @@
203 // Convert high-byte and low-byte to 16-bit word.
204 inline uint_least16_t endian_16 (uint8_t hi, uint8_t lo)
206 - uint_least16_t word;
207 + uint_least16_t word = 0;
208 endian_16lo8 (word, lo);
209 endian_16hi8 (word, hi);
210 return word;
211 @@ -165,7 +169,7 @@
213 inline void endian_16 (char ptr[2], uint_least16_t word)
215 - endian_16 ((uint8_t *) ptr, word);
216 + endian_16 ((uint8_t *) ptr, word);
219 // Convert high-byte and low-byte to 16-bit little endian word.
220 @@ -334,7 +338,7 @@
221 // Swap word endian.
222 inline void endian_32swap8 (uint_least32_t &dword)
224 - uint_least16_t lo, hi;
225 + uint_least16_t lo = 0, hi = 0;
226 lo = endian_32lo16 (dword);
227 hi = endian_32hi16 (dword);
228 endian_16swap8 (lo);
229 @@ -346,8 +350,8 @@
230 // Convert high-byte and low-byte to 32-bit word.
231 inline uint_least32_t endian_32 (uint8_t hihi, uint8_t hilo, uint8_t hi, uint8_t lo)
233 - uint_least32_t dword;
234 - uint_least16_t word;
235 + uint_least32_t dword = 0;
236 + uint_least16_t word = 0;
237 endian_32lo8 (dword, lo);
238 endian_32hi8 (dword, hi);
239 endian_16lo8 (word, hilo);
240 @@ -374,7 +378,7 @@
241 defined(SID_WORDS_LITTLEENDIAN)
242 *((uint_least32_t *) ptr) = dword;
243 #else
244 - uint_least16_t word;
245 + uint_least16_t word = 0;
246 ptr[0] = endian_32lo8 (dword);
247 ptr[1] = endian_32hi8 (dword);
248 word = endian_32hi16 (dword);
249 @@ -401,7 +405,7 @@
250 defined(SID_WORDS_BIGENDIAN)
251 *((uint_least32_t *) ptr) = dword;
252 #else
253 - uint_least16_t word;
254 + uint_least16_t word = 0;
255 word = endian_32hi16 (dword);
256 ptr[1] = endian_16lo8 (word);
257 ptr[0] = endian_16hi8 (word);
258 --- sidplay-libs-2.1.1.orig/libsidplay/unix/config.h.in
259 +++ sidplay-libs-2.1.1/libsidplay/unix/config.h.in
260 @@ -72,22 +72,22 @@
261 /* Define to the version of this package. */
262 #undef PACKAGE_VERSION
264 -/* The size of a `char', as computed by sizeof. */
265 +/* The size of `char', as computed by sizeof. */
266 #undef SIZEOF_CHAR
268 -/* The size of a `int', as computed by sizeof. */
269 +/* The size of `int', as computed by sizeof. */
270 #undef SIZEOF_INT
272 /* The number of bytes in type long */
273 #undef SIZEOF_LONG
275 -/* The size of a `long int', as computed by sizeof. */
276 +/* The size of `long int', as computed by sizeof. */
277 #undef SIZEOF_LONG_INT
279 /* The number of bytes in type short */
280 #undef SIZEOF_SHORT
282 -/* The size of a `short int', as computed by sizeof. */
283 +/* The size of `short int', as computed by sizeof. */
284 #undef SIZEOF_SHORT_INT
286 /* The number of bytes in type void* */
287 --- sidplay-libs-2.1.1.orig/libsidplay/unix/my_macros.m4
288 +++ sidplay-libs-2.1.1/libsidplay/unix/my_macros.m4
289 @@ -105,8 +105,9 @@
290 AC_CACHE_VAL(test_cv_have_ios_openmode,
292 AC_TRY_COMPILE(
293 - [#include <fstream.h>
294 - #include <iomanip.h>],
295 + [#include <fstream>
296 + #include <iomanip>
297 + using namespace std;],
298 [ios::openmode myTest = ios::in;],
299 [test_cv_have_ios_openmode=yes],
300 [test_cv_have_ios_openmode=no]
301 --- sidplay-libs-2.1.1.orig/libsidplay/unix/sidint.h
302 +++ sidplay-libs-2.1.1/libsidplay/unix/sidint.h
303 @@ -0,0 +1,17 @@
304 +#ifndef _UNIX_SIDINT_H
305 +#define _UNIX_SIDINT_H 1
306 +#ifndef _GENERATED_STDINT_H
307 +#define _GENERATED_STDINT_H "libsidplay 2.1.1"
308 +/* generated using a gnu compiler version gcc (Debian 4.3-20080219-1) 4.3.0 20080219 (prerelease) [gcc-4_3-branch revision 132456] Copyright (C) 2007 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. */
310 +#include <stdint.h>
313 +/* system headers have good uint64_t */
314 +#ifndef _HAVE_UINT64_T
315 +#define _HAVE_UINT64_T
316 +#endif
318 + /* once */
319 +#endif
320 +#endif
321 --- sidplay-libs-2.1.1.orig/libsidutils/include/sidplay/utils/SidUsage.h
322 +++ sidplay-libs-2.1.1/libsidutils/include/sidplay/utils/SidUsage.h
323 @@ -33,7 +33,7 @@
324 uint_least16_t length; // usage scan length
326 // Copy common parts of basic usage to extended usage.
327 - sid2_usage_t &sid2_usage_t::operator= (const sid_usage_t &usage)
328 + sid2_usage_t &operator= (const sid_usage_t &usage)
330 *((sid_usage_t *) this) = usage;
331 return *this;