Fails to build on macOS Sonoma (BSD iconv.h)
Qt-based Multimedia Player
Brought to you by:
trialuser02
I was looking into QMMP build failure on macOS Sonoma in Homebrew - https://github.com/Homebrew/homebrew-core/pull/182862
The error is:
/tmp/qmmp-20240828-19582-sf4k85/qmmp-2.1.9/src/qmmp/qmmptextcodec.h:28:15: error: typedef redefinition with different types ('void *' vs 'struct __tag_iconv_t *')
This appears to be due to BSD iconv.h (which Apple switched to in macOS 14 Sonoma) having a different definition of iconv_t:
struct __tag_iconv_t;
typedef struct __tag_iconv_t *iconv_t;
Is there a specific reason for the typedef in https://sourceforge.net/p/qmmp-dev/code/HEAD/tree/trunk/qmmp/src/qmmp/qmmptextcodec.h#l28 ?
Specifically, why not use #include <iconv.h> ?
Based on https://pubs.opengroup.org/onlinepubs/009695399/basedefs/iconv.h.html, POSIX does not restrict the type of iconv_t but it must exist to be compliant.
Fixed by [r11774]. Thank you!
Related
Commit: [r11774]