Skip to content

Commit

Permalink
Fix ICONV_CONST build failure
Browse files Browse the repository at this point in the history
  • Loading branch information
rockdaboot committed Jan 13, 2024
1 parent 2b05532 commit 895b272
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/psl.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,13 @@ typedef SSIZE_T ssize_t;
# include <unistr.h>
#endif

#ifndef WINICONV_CONST
# define WINICONV_CONST ICONV_CONST
#ifdef WINICONV_CONST
# define ICONV_CONST WINICONV_CONST
#endif
#ifndef ICONV_CONST
# define ICONV_CONST
#endif


#include <libpsl.h>

Expand Down Expand Up @@ -1835,7 +1839,7 @@ psl_error_t psl_str_to_utf8lower(const char *str, const char *encoding PSL_UNUSE
if (!dst) {
ret = PSL_ERR_NO_MEM;
}
else if (iconv(cd, (WINICONV_CONST char **)&tmp, &tmp_len, &dst_tmp, &dst_len_tmp) != (size_t)-1
else if (iconv(cd, (ICONV_CONST char **)&tmp, &tmp_len, &dst_tmp, &dst_len_tmp) != (size_t)-1
&& iconv(cd, NULL, NULL, &dst_tmp, &dst_len_tmp) != (size_t)-1)
{
/* start size for u8_tolower internal memory allocation.
Expand Down

0 comments on commit 895b272

Please sign in to comment.