Changeset 14682


Ignore:
Timestamp:
Feb 23, 2016, 5:07:43 AM (6 years ago)
Author:
mikedld
Message:

Fix warning for when 2nd iconv() argument is const

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/CMakeLists.txt

    r14680 r14682  
    515515if(ICONV_FOUND)
    516516    add_definitions(-DHAVE_ICONV)
     517    if(ICONV_SECOND_ARGUMENT_IS_CONST)
     518        add_definitions(-DICONV_SECOND_ARGUMENT_IS_CONST)
     519    endif()
    517520endif()
    518521
  • trunk/cmake/FindICONV.cmake

    r14350 r14682  
    2323    set(CMAKE_REQUIRED_LIBRARIES ${ICONV_LIBRARIES})
    2424
    25     check_c_source_compiles(
    26         "
     25    check_c_source_compiles("
    2726        #include <iconv.h>
    2827        int main ()
     
    3534            iconv (conv, &in, &ilen, &out, &olen);
    3635            return 0;
    37         }" ICONV_SECOND_ARGUMENT_IS_CONST)
     36        }"
     37        ICONV_SECOND_ARGUMENT_IS_CONST
     38        FAIL_REGEX "incompatible pointer type"
     39        FAIL_REGEX "discards qualifiers in nested pointer types")
    3840
    3941    set(CMAKE_REQUIRED_INCLUDES)
  • trunk/libtransmission/utils.c

    r14678 r14682  
    10351035  for (i=0; !ret && i<encoding_count; ++i)
    10361036    {
     1037#ifdef ICONV_SECOND_ARGUMENT_IS_CONST
     1038      const char * inbuf = in;
     1039#else
    10371040      char * inbuf = (char*) in;
     1041#endif
    10381042      char * outbuf = out;
    10391043      size_t inbytesleft = inlen;
Note: See TracChangeset for help on using the changeset viewer.