Changeset 14678


Ignore:
Timestamp:
Feb 7, 2016, 11:54:01 AM (6 years ago)
Author:
mikedld
Message:

Check for iconv() instead of iconv_open(), adjust utils test

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/CMakeLists.txt

    r14671 r14678  
    155155find_package(CURL ${CURL_MINIMUM} REQUIRED)
    156156
    157 if(UNIX)
    158     find_package(ICONV REQUIRED)
    159 endif()
     157find_package(ICONV)
    160158
    161159if(WITH_CRYPTO STREQUAL "AUTO" OR WITH_CRYPTO STREQUAL "openssl")
     
    491489    getpagesize
    492490    htonll
    493     iconv_open
    494491    localtime_r
    495492    memmem
     
    516513endforeach()
    517514
     515if(ICONV_FOUND)
     516    add_definitions(-DHAVE_ICONV_OPEN)
     517endif()
     518
    518519# if(MINGW)
    519520#     check_function_exists(__mingw_printf HAVE_MINGW_PRINTF)
  • trunk/Transmission.xcodeproj/project.pbxproj

    r14668 r14678  
    33323332                                        "-DHAVE_STRCASECMP",
    33333333                                        "-DHAVE_ZLIB",
     3334                                        "-DHAVE_ICONV",
    33343335                                );
    3335                                 OTHER_CPLUSPLUSFLAGS = "$(OTHER_CFLAGS)";
    33363336                                PRODUCT_NAME = transmission;
    33373337                        };
     
    34973497                                        "-DHAVE_STRCASECMP",
    34983498                                        "-DHAVE_ZLIB",
     3499                                        "-DHAVE_ICONV",
    34993500                                );
    35003501                                PRODUCT_NAME = transmission;
     
    37103711                                        "-DHAVE_STRCASECMP",
    37113712                                        "-DHAVE_ZLIB",
     3713                                        "-DHAVE_ICONV",
    37123714                                );
    37133715                                PRODUCT_NAME = transmission;
  • trunk/configure.ac

    r14660 r14678  
    108108
    109109AC_CHECK_HEADERS([stdbool.h xlocale.h])
    110 AC_CHECK_FUNCS([iconv_open pread pwrite lrintf strlcpy daemon dirname basename canonicalize_file_name strcasecmp localtime_r fallocate64 posix_fallocate memmem strsep strtold syslog valloc getpagesize posix_memalign statvfs htonll ntohll mkdtemp uselocale _configthreadlocale])
     110AC_CHECK_FUNCS([iconv pread pwrite lrintf strlcpy daemon dirname basename canonicalize_file_name strcasecmp localtime_r fallocate64 posix_fallocate memmem strsep strtold syslog valloc getpagesize posix_memalign statvfs htonll ntohll mkdtemp uselocale _configthreadlocale])
    111111AC_PROG_INSTALL
    112112AC_PROG_MAKE_SET
  • trunk/libtransmission/utils-test.c

    r14677 r14678  
    134134  out = tr_utf8clean (in, 4);
    135135  check (out != NULL);
    136   check_streq ("?", out);
     136  check ((strlen (out) == 1) || (strlen (out) == 2));
    137137  check (tr_utf8_validate (out, TR_BAD_SIZE, NULL));
    138138  tr_free (out);
     
    141141  out = tr_utf8clean (in, 4);
    142142  check (out != NULL);
    143   check_streq ("?3??", out);
     143  check ((strlen (out) == 4) || (strlen (out) == 7));
    144144  check (tr_utf8_validate (out, TR_BAD_SIZE, NULL));
    145145  tr_free (out);
  • trunk/libtransmission/utils.c

    r14641 r14678  
    1414#if defined (XCODE_BUILD)
    1515 #define HAVE_GETPAGESIZE
    16  #define HAVE_ICONV_OPEN
    1716 #define HAVE_VALLOC
    1817#endif
     
    3837#endif
    3938
    40 #ifdef HAVE_ICONV_OPEN
     39#ifdef HAVE_ICONV
    4140 #include <iconv.h>
    4241#endif
     
    10271026  char * ret = NULL;
    10281027
    1029 #ifdef HAVE_ICONV_OPEN
     1028#ifdef HAVE_ICONV
    10301029  int i;
    10311030  const char * encodings[] = { "CURRENT", "ISO-8859-15" };
Note: See TracChangeset for help on using the changeset viewer.