(svn r21634) -Codechange: apparantly the "broken" iconv interface is the new official interface, so update the variable/definition naming slightly as it's not broken just different from the earlier iconv interface

replace/41b28d7194a279bdc17475d4fbe2ea6ec885a466
rubidium 14 years ago
parent d8b823142e
commit 2c4c6b4fe1

@ -1658,8 +1658,8 @@ make_cflags_and_ldflags() {
fi fi
fi fi
if [ "$have_broken_iconv" != "no" ]; then if [ "$have_non_const_iconv" != "no" ]; then
CFLAGS="$CFLAGS -DHAVE_BROKEN_ICONV" CFLAGS="$CFLAGS -DHAVE_NON_CONST_ICONV"
fi fi
fi fi
@ -2916,9 +2916,9 @@ detect_iconv() {
log 1 "checking iconv... found" log 1 "checking iconv... found"
# Check if we need to work around buggy iconv implementation where inbuf # There are different implementations of iconv. The older ones,
# is wrongly typed as non-const. Correct implementation is at # e.g. SUSv2, pass a const pointer, whereas the newer ones, e.g.
# http://www.opengroup.org/onlinepubs/007908799/xsh/iconv.html # IEEE 1003.1 (2004), pass a non-const pointer.
cat > tmp.iconv.cpp << EOF cat > tmp.iconv.cpp << EOF
#include "src/stdafx.h" #include "src/stdafx.h"
@ -2938,8 +2938,8 @@ EOF
ret=$? ret=$?
log 2 "executing $execute" log 2 "executing $execute"
log 2 " exit code $ret" log 2 " exit code $ret"
if [ "$ret" = "0" ]; then have_broken_iconv="no"; else have_broken_iconv="yes"; fi if [ "$ret" = "0" ]; then have_non_const_iconv="no"; else have_non_const_iconv="yes"; fi
log 1 "checking if iconv has non-const inbuf... $have_broken_iconv" log 1 "checking if iconv has non-const inbuf... $have_non_const_iconv"
cat > tmp.iconv.cpp << EOF cat > tmp.iconv.cpp << EOF
#include "src/stdafx.h" #include "src/stdafx.h"
@ -3249,13 +3249,13 @@ generate_src_osx() {
# We don't want to duplicate the x86_64 stuff for each target, so do it once here # We don't want to duplicate the x86_64 stuff for each target, so do it once here
if [ "$type" = "ppc64" ] || [ "$type" = "x86_64" ]; then if [ "$type" = "ppc64" ] || [ "$type" = "x86_64" ]; then
# 64 bits is always 10.5 or higher. Furthermore it has a broken ICONV # 64 bits is always 10.5 or higher. Furthermore it has a non const ICONV
# and they also removed support for QuickTime/QuickDraw # and they also removed support for QuickTime/QuickDraw
if [ -n "$osx_sdk_path" ]; then if [ -n "$osx_sdk_path" ]; then
CFLAGS="-isysroot $osx_sdk_path $CFLAGS_orig" CFLAGS="-isysroot $osx_sdk_path $CFLAGS_orig"
LDFLAGS="-Wl,-syslibroot,$osx_sdk_path $LDFLAGS_orig" LDFLAGS="-Wl,-syslibroot,$osx_sdk_path $LDFLAGS_orig"
fi fi
CFLAGS="$CFLAGS -D_SQ64 -DHAVE_BROKEN_ICONV -DNO_QUICKTIME -UENABLE_COCOA_QUICKDRAW" CFLAGS="$CFLAGS -D_SQ64 -DHAVE_NON_CONST_ICONV -DNO_QUICKTIME -UENABLE_COCOA_QUICKDRAW"
LIBS="`echo $LIBS | sed 's/-framework QuickTime//'`" LIBS="`echo $LIBS | sed 's/-framework QuickTime//'`"
fi fi

@ -151,10 +151,10 @@ static const char *GetLocalCode()
static const char *convert_tofrom_fs(iconv_t convd, const char *name) static const char *convert_tofrom_fs(iconv_t convd, const char *name)
{ {
static char buf[1024]; static char buf[1024];
/* Work around buggy iconv implementation where inbuf is wrongly typed as /* There are different implementations of iconv. The older ones,
* non-const. Correct implementation is at * e.g. SUSv2, pass a const pointer, whereas the newer ones, e.g.
* http://www.opengroup.org/onlinepubs/007908799/xsh/iconv.html */ * IEEE 1003.1 (2004), pass a non-const pointer. */
#ifdef HAVE_BROKEN_ICONV #ifdef HAVE_NON_CONST_ICONV
char *inbuf = const_cast<char*>(name); char *inbuf = const_cast<char*>(name);
#else #else
const char *inbuf = name; const char *inbuf = name;

Loading…
Cancel
Save