{"thread":{"id":"64634","subject":"[PATCH v0 3/3] config.mak.uname: Activate ICONV_RESTART_RESET if needed","startedAt":"2025-12-15T20:45:33Z","lastAt":"2025-12-15T20:45:33Z","messageCount":1,"participants":["tboegi@web.de"],"isPatch":true,"patchVersion":0,"patchTotal":3},"messages":[{"id":"532204","messageId":"20251215204524.1946518-1-tboegi@web.de","threadId":"64634","inReplyTo":null,"subject":"[PATCH v0 3/3] config.mak.uname: Activate ICONV_RESTART_RESET if needed","fromName":"","fromEmail":"tboegi@web.de","sentAt":"2025-12-15T20:45:24Z","receivedAt":"2025-12-15T20:45:33Z","isPatch":true,"sender":{"key":"tboegi@web.de","avatar":"https://avatars.githubusercontent.com/u/7138363?v=4"},"body":"From: Torsten Bögershausen <tboegi@web.de>\n\nutf8.c needs a tweak when calling the iconv library shipped with later\nmacOS versions (14,15):\n'#define ICONV_RESTART_RESET' is needed, or\n'BASIC_CFLAGS += -DICONV_RESTART_RESET' in Makefile language.\n\nThe tweak is not needed when Git is linked against iconv from\nFink or MacPorts or homebrew.\nNeither when Git is compiled under older macOS versions.\n\nSigned-off-by: Torsten Bögershausen <tboegi@web.de>\n---\n config.mak.uname | 10 ++++++++++\n 1 file changed, 10 insertions(+)\n\ndiff --git a/config.mak.uname b/config.mak.uname\nindex 44252dabcc..b76a51e22b 100644\n--- a/config.mak.uname\n+++ b/config.mak.uname\n@@ -174,9 +174,11 @@ ifeq ($(uname_S),Darwin)\n \n         ifeq ($(shell test -d /usr/local/opt/libiconv/ && echo y),y)\n \t\tHOMEBREW_ICONVDIR = /usr/local/opt/libiconv\n+\t\tHAS_GOOD_ICONV = Yes\n         endif\n         ifeq ($(shell test -d /opt/homebrew/opt/libiconv/ && echo y),y)\n \t\tHOMEBREW_ICONVDIR = /opt/homebrew/opt/libiconv\n+\t\tHAS_GOOD_ICONV = Yes\n         endif\n \n \t# The builtin FSMonitor on MacOS builds upon Simple-IPC.  Both require\n@@ -193,12 +195,14 @@ ifeq ($(uname_S),Darwin)\n \t\tifeq ($(shell test -d /sw/lib && echo y),y)\n \t\t\tBASIC_CFLAGS += -I/sw/include\n \t\t\tBASIC_LDFLAGS += -L/sw/lib\n+\t\t\tHAS_GOOD_ICONV = Yes\n \t\tendif\n \tendif\n \tifndef NO_DARWIN_PORTS\n \t\tifeq ($(shell test -d /opt/local/lib && echo y),y)\n \t\t\tBASIC_CFLAGS += -I/opt/local/include\n \t\t\tBASIC_LDFLAGS += -L/opt/local/lib\n+\t\t\tHAS_GOOD_ICONV = Yes\n \t\tendif\n \tendif\n \tifndef NO_APPLE_COMMON_CRYPTO\n@@ -206,6 +210,12 @@ ifeq ($(uname_S),Darwin)\n \t\tAPPLE_COMMON_CRYPTO = YesPlease\n \t\tCOMPAT_CFLAGS += -DAPPLE_COMMON_CRYPTO\n \tendif\n+\tifndef HAS_GOOD_ICONV\n+\t\tifeq ($(shell test \"`expr \"$(uname_R)\" : '\\([0-9][0-9]*\\)\\.'`\" -ge 20 && echo 1),1)\n+\t\t# utf8.c needs a tweak when using iconv from os\n+\t\t\tBASIC_CFLAGS += -DICONV_RESTART_RESET\n+\t\tendif\n+\tendif\n \tPTHREAD_LIBS =\n endif\n ifeq ($(uname_S),SunOS)\n-- \n2.50.0.rc0.46.g7014b55638.dirty\n\n"}]}