{"thread":{"id":"10583","subject":"[PATCH] Mac OS X 10.5 does not require the OLD_ICONV flag set","startedAt":"2007-11-02T02:38:21Z","lastAt":"2007-11-03T00:21:48Z","messageCount":15,"participants":["Blake Ramsdell","Junio C Hamano","Mike Hommey","Benoit SIGOURE","David Symonds"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"57922","messageId":"1193971102-61907-1-git-send-email-blaker@gmail.com","threadId":"10583","inReplyTo":null,"subject":"[PATCH] Mac OS X 10.5 does not require the OLD_ICONV flag set","fromName":"Blake Ramsdell","fromEmail":"blaker@gmail.com","sentAt":"2007-11-02T02:38:21Z","receivedAt":"2007-11-02T02:38:21Z","isPatch":true,"sender":{"key":"blaker@gmail.com","avatar":"https://gravatar.com/avatar/2bfd39d25cb244dc4354573d5ca413a1adb793017b48cfa84baaf98b77be2a3b?d=mp&s=160"},"body":"Signed-off-by: Blake Ramsdell <blaker@gmail.com>\n---\n Makefile |    4 +++-\n 1 files changed, 3 insertions(+), 1 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 71479a2..5d83756 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -401,7 +401,9 @@ endif\n ifeq ($(uname_S),Darwin)\n \tNEEDS_SSL_WITH_CRYPTO = YesPlease\n \tNEEDS_LIBICONV = YesPlease\n-\tOLD_ICONV = UnfortunatelyYes\n+\tifneq ($(uname_R),9.0.0)\n+\t\tOLD_ICONV = UnfortunatelyYes\n+\tendif\n \tNO_STRLCPY = YesPlease\n \tNO_MEMMEM = YesPlease\n endif\n-- \n1.5.3.GIT\n"},{"id":"57923","messageId":"1193971102-61907-2-git-send-email-blaker@gmail.com","threadId":"10583","inReplyTo":"1193971102-61907-1-git-send-email-blaker@gmail.com","subject":"[PATCH] Fixed a gcc 4.0.1 complaint about an uninitialized variable","fromName":"Blake Ramsdell","fromEmail":"blaker@gmail.com","sentAt":"2007-11-02T02:38:22Z","receivedAt":"2007-11-02T02:38:22Z","isPatch":true,"sender":{"key":"blaker@gmail.com","avatar":"https://gravatar.com/avatar/2bfd39d25cb244dc4354573d5ca413a1adb793017b48cfa84baaf98b77be2a3b?d=mp&s=160"},"body":"Signed-off-by: Blake Ramsdell <blaker@gmail.com>\n---\n transport.c |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/transport.c b/transport.c\nindex 400af71..cac1870 100644\n--- a/transport.c\n+++ b/transport.c\n@@ -107,7 +107,7 @@ static void insert_packed_refs(const char *packed_refs, struct ref **list)\n \t\treturn;\n \n \tfor (;;) {\n-\t\tint cmp, len;\n+\t\tint cmp = 0, len;\n \n \t\tif (!fgets(buffer, sizeof(buffer), f)) {\n \t\t\tfclose(f);\n-- \n1.5.3.GIT\n"},{"id":"57928","messageId":"7v8x5h6wd0.fsf@gitster.siamese.dyndns.org","threadId":"10583","inReplyTo":"1193971102-61907-2-git-send-email-blaker@gmail.com","subject":"Re: [PATCH] Fixed a gcc 4.0.1 complaint about an uninitialized variable","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-11-02T05:37:47Z","receivedAt":"2007-11-02T05:37:47Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Blake Ramsdell <blaker@gmail.com> writes:\n\n> diff --git a/transport.c b/transport.c\n> index 400af71..cac1870 100644\n> --- a/transport.c\n> +++ b/transport.c\n> @@ -107,7 +107,7 @@ static void insert_packed_refs(const char *packed_refs, struct ref **list)\n>  \t\treturn;\n>  \n>  \tfor (;;) {\n> -\t\tint cmp, len;\n> +\t\tint cmp = 0, len;\n\nYeah, if you follow the logic, it is clear that the variable is\nnever used while unset, but gcc is not careful enough to see it.\n\nIt is customary to use\n\n\tint cmp = cmp;\n\nfor something like this.  There are already other instances of\nsuch phony initializations in the code elsewhere.\n"},{"id":"57941","messageId":"7v4pg55893.fsf@gitster.siamese.dyndns.org","threadId":"10583","inReplyTo":"1193971102-61907-1-git-send-email-blaker@gmail.com","subject":"Re: [PATCH] Mac OS X 10.5 does not require the OLD_ICONV flag set","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-11-02T09:03:52Z","receivedAt":"2007-11-02T09:03:52Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Blake Ramsdell <blaker@gmail.com> writes:\n\n> Signed-off-by: Blake Ramsdell <blaker@gmail.com>\n> ---\n>  Makefile |    4 +++-\n>  1 files changed, 3 insertions(+), 1 deletions(-)\n>\n> diff --git a/Makefile b/Makefile\n> index 71479a2..5d83756 100644\n> --- a/Makefile\n> +++ b/Makefile\n> @@ -401,7 +401,9 @@ endif\n>  ifeq ($(uname_S),Darwin)\n>  \tNEEDS_SSL_WITH_CRYPTO = YesPlease\n>  \tNEEDS_LIBICONV = YesPlease\n> -\tOLD_ICONV = UnfortunatelyYes\n> +\tifneq ($(uname_R),9.0.0)\n> +\t\tOLD_ICONV = UnfortunatelyYes\n> +\tendif\n>  \tNO_STRLCPY = YesPlease\n>  \tNO_MEMMEM = YesPlease\n>  endif\n\nI do not have an access to a Darwin box, but do you mean 10.5\ngives 9.0.0 as uname_R?\n"},{"id":"57945","messageId":"985966520711020220q5d0b0481r9b95f4429f8680c6@mail.gmail.com","threadId":"10583","inReplyTo":"7v4pg55893.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] Mac OS X 10.5 does not require the OLD_ICONV flag set","fromName":"Blake Ramsdell","fromEmail":"blaker@gmail.com","sentAt":"2007-11-02T09:20:21Z","receivedAt":"2007-11-02T09:20:21Z","isPatch":true,"sender":{"key":"blaker@gmail.com","avatar":"https://gravatar.com/avatar/2bfd39d25cb244dc4354573d5ca413a1adb793017b48cfa84baaf98b77be2a3b?d=mp&s=160"},"body":"On 11/2/07, Junio C Hamano <gitster@pobox.com> wrote:\n> I do not have an access to a Darwin box, but do you mean 10.5\n> gives 9.0.0 as uname_R?\n\nYeah, apparently that's how they roll.\n\n~/Source/OpenSource/git$ uname -r\n9.0.0\n~/Source/OpenSource/git$ system_profiler SPSoftwareDataType\nSoftware:\n\n    System Software Overview:\n\n      System Version: Mac OS X 10.5 (9A581)\n      Kernel Version: Darwin 9.0.0\n\nBlake\n-- \nBlake Ramsdell | http://www.blakeramsdell.com\n"},{"id":"57948","messageId":"20071102093028.GA29699@glandium.org","threadId":"10583","inReplyTo":"7v4pg55893.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] Mac OS X 10.5 does not require the OLD_ICONV flag set","fromName":"Mike Hommey","fromEmail":"mh@glandium.org","sentAt":"2007-11-02T09:30:28Z","receivedAt":"2007-11-02T09:30:28Z","isPatch":true,"sender":{"key":"mh@glandium.org","avatar":"https://avatars.githubusercontent.com/u/1038527?v=4"},"body":"On Fri, Nov 02, 2007 at 02:03:52AM -0700, Junio C Hamano <gitster@pobox.com> wrote:\n> Blake Ramsdell <blaker@gmail.com> writes:\n> \n> > Signed-off-by: Blake Ramsdell <blaker@gmail.com>\n> > ---\n> >  Makefile |    4 +++-\n> >  1 files changed, 3 insertions(+), 1 deletions(-)\n> >\n> > diff --git a/Makefile b/Makefile\n> > index 71479a2..5d83756 100644\n> > --- a/Makefile\n> > +++ b/Makefile\n> > @@ -401,7 +401,9 @@ endif\n> >  ifeq ($(uname_S),Darwin)\n> >  \tNEEDS_SSL_WITH_CRYPTO = YesPlease\n> >  \tNEEDS_LIBICONV = YesPlease\n> > -\tOLD_ICONV = UnfortunatelyYes\n> > +\tifneq ($(uname_R),9.0.0)\n> > +\t\tOLD_ICONV = UnfortunatelyYes\n> > +\tendif\n> >  \tNO_STRLCPY = YesPlease\n> >  \tNO_MEMMEM = YesPlease\n> >  endif\n> \n> I do not have an access to a Darwin box, but do you mean 10.5\n> gives 9.0.0 as uname_R?\n\nBe it that or not, it looks wrong to me to check the Darwin version to\nknow what to use. Do you rely on the Linux kernel version to know whether\niconv is present ?\n\nMike\n"},{"id":"57952","messageId":"B858412A-853A-4660-BA4B-F9751E4AAEAE@lrde.epita.fr","threadId":"10583","inReplyTo":"20071102093028.GA29699@glandium.org","subject":"Re: [PATCH] Mac OS X 10.5 does not require the OLD_ICONV flag set","fromName":"Benoit SIGOURE","fromEmail":"tsuna@lrde.epita.fr","sentAt":"2007-11-02T09:39:35Z","receivedAt":"2007-11-02T09:39:35Z","isPatch":true,"sender":{"key":"tsunanet@gmail.com","avatar":"https://avatars.githubusercontent.com/u/128281?v=4"},"body":"On Nov 2, 2007, at 10:30 AM, Mike Hommey wrote:\n\n> On Fri, Nov 02, 2007 at 02:03:52AM -0700, Junio C Hamano  \n> <gitster@pobox.com> wrote:\n>> Blake Ramsdell <blaker@gmail.com> writes:\n>>\n>>> Signed-off-by: Blake Ramsdell <blaker@gmail.com>\n>>> ---\n>>>  Makefile |    4 +++-\n>>>  1 files changed, 3 insertions(+), 1 deletions(-)\n>>>\n>>> diff --git a/Makefile b/Makefile\n>>> index 71479a2..5d83756 100644\n>>> --- a/Makefile\n>>> +++ b/Makefile\n>>> @@ -401,7 +401,9 @@ endif\n>>>  ifeq ($(uname_S),Darwin)\n>>>  \tNEEDS_SSL_WITH_CRYPTO = YesPlease\n>>>  \tNEEDS_LIBICONV = YesPlease\n>>> -\tOLD_ICONV = UnfortunatelyYes\n>>> +\tifneq ($(uname_R),9.0.0)\n>>> +\t\tOLD_ICONV = UnfortunatelyYes\n>>> +\tendif\n>>>  \tNO_STRLCPY = YesPlease\n>>>  \tNO_MEMMEM = YesPlease\n>>>  endif\n>>\n>> I do not have an access to a Darwin box, but do you mean 10.5\n>> gives 9.0.0 as uname_R?\n>\n> Be it that or not, it looks wrong to me to check the Darwin version to\n> know what to use. Do you rely on the Linux kernel version to know  \n> whether\n> iconv is present ?\n\nIt's very different, on OSX you don't change your own kernel as you  \nwant, the kernel isn't a standalone component, it comes packaged with  \nthe entire system of MacOSX.  When you do an update to 10.5 (aka  \nLeopard) you will have a new version of iconv so you're guaranteed  \nthat someone with 10.5 has a system-wide iconv that is not OLD_ICONV.\n\n-- \nBenoit Sigoure aka Tsuna\nEPITA Research and Development Laboratory\n\n\n"},{"id":"57954","messageId":"20071102094508.GA29828@glandium.org","threadId":"10583","inReplyTo":"B858412A-853A-4660-BA4B-F9751E4AAEAE@lrde.epita.fr","subject":"Re: [PATCH] Mac OS X 10.5 does not require the OLD_ICONV flag set","fromName":"Mike Hommey","fromEmail":"mh@glandium.org","sentAt":"2007-11-02T09:45:08Z","receivedAt":"2007-11-02T09:45:08Z","isPatch":true,"sender":{"key":"mh@glandium.org","avatar":"https://avatars.githubusercontent.com/u/1038527?v=4"},"body":"On Fri, Nov 02, 2007 at 10:39:35AM +0100, Benoit SIGOURE <tsuna@lrde.epita.fr> wrote:\n> On Nov 2, 2007, at 10:30 AM, Mike Hommey wrote:\n> \n> >On Fri, Nov 02, 2007 at 02:03:52AM -0700, Junio C Hamano  \n> ><gitster@pobox.com> wrote:\n> >>Blake Ramsdell <blaker@gmail.com> writes:\n> >>\n> >>>Signed-off-by: Blake Ramsdell <blaker@gmail.com>\n> >>>---\n> >>> Makefile |    4 +++-\n> >>> 1 files changed, 3 insertions(+), 1 deletions(-)\n> >>>\n> >>>diff --git a/Makefile b/Makefile\n> >>>index 71479a2..5d83756 100644\n> >>>--- a/Makefile\n> >>>+++ b/Makefile\n> >>>@@ -401,7 +401,9 @@ endif\n> >>> ifeq ($(uname_S),Darwin)\n> >>> \tNEEDS_SSL_WITH_CRYPTO = YesPlease\n> >>> \tNEEDS_LIBICONV = YesPlease\n> >>>-\tOLD_ICONV = UnfortunatelyYes\n> >>>+\tifneq ($(uname_R),9.0.0)\n> >>>+\t\tOLD_ICONV = UnfortunatelyYes\n> >>>+\tendif\n> >>> \tNO_STRLCPY = YesPlease\n> >>> \tNO_MEMMEM = YesPlease\n> >>> endif\n> >>\n> >>I do not have an access to a Darwin box, but do you mean 10.5\n> >>gives 9.0.0 as uname_R?\n> >\n> >Be it that or not, it looks wrong to me to check the Darwin version to\n> >know what to use. Do you rely on the Linux kernel version to know  \n> >whether\n> >iconv is present ?\n> \n> It's very different, on OSX you don't change your own kernel as you  \n> want, the kernel isn't a standalone component, it comes packaged with  \n> the entire system of MacOSX.  When you do an update to 10.5 (aka  \n> Leopard) you will have a new version of iconv so you're guaranteed  \n> that someone with 10.5 has a system-wide iconv that is not OLD_ICONV.\n\nThe fact is you can also use Darwin without OSX...\n\nMike\n"},{"id":"57960","messageId":"ee77f5c20711020319l26b4a8c1r99576dc29ea504d8@mail.gmail.com","threadId":"10583","inReplyTo":"7v4pg55893.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] Mac OS X 10.5 does not require the OLD_ICONV flag set","fromName":"David Symonds","fromEmail":"dsymonds@gmail.com","sentAt":"2007-11-02T10:19:31Z","receivedAt":"2007-11-02T10:19:31Z","isPatch":true,"sender":{"key":"dsymonds@gmail.com","avatar":"https://gravatar.com/avatar/b22f5051cbfc11836e36cf7a690e6cde4e225d835e13295ff98d15c7a9ee3c0f?d=mp&s=160"},"body":"On 11/2/07, Junio C Hamano <gitster@pobox.com> wrote:\n> Blake Ramsdell <blaker@gmail.com> writes:\n>\n> > Signed-off-by: Blake Ramsdell <blaker@gmail.com>\n> > ---\n> >  Makefile |    4 +++-\n> >  1 files changed, 3 insertions(+), 1 deletions(-)\n> >\n> > diff --git a/Makefile b/Makefile\n> > index 71479a2..5d83756 100644\n> > --- a/Makefile\n> > +++ b/Makefile\n> > @@ -401,7 +401,9 @@ endif\n> >  ifeq ($(uname_S),Darwin)\n> >       NEEDS_SSL_WITH_CRYPTO = YesPlease\n> >       NEEDS_LIBICONV = YesPlease\n> > -     OLD_ICONV = UnfortunatelyYes\n> > +     ifneq ($(uname_R),9.0.0)\n> > +             OLD_ICONV = UnfortunatelyYes\n> > +     endif\n> >       NO_STRLCPY = YesPlease\n> >       NO_MEMMEM = YesPlease\n> >  endif\n>\n> I do not have an access to a Darwin box, but do you mean 10.5\n> gives 9.0.0 as uname_R?\n\nFurther, that comparison is going to fail as soon as the next revision\nof Darwin (9.0.1, etc.) is released.\n\n\nDave.\n"},{"id":"57962","messageId":"7vbqad3pjw.fsf@gitster.siamese.dyndns.org","threadId":"10583","inReplyTo":"ee77f5c20711020319l26b4a8c1r99576dc29ea504d8@mail.gmail.com","subject":"Re: [PATCH] Mac OS X 10.5 does not require the OLD_ICONV flag set","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-11-02T10:33:07Z","receivedAt":"2007-11-02T10:33:07Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"David Symonds\" <dsymonds@gmail.com> writes:\n\n> On 11/2/07, Junio C Hamano <gitster@pobox.com> wrote:\n>> Blake Ramsdell <blaker@gmail.com> writes:\n>>\n>> > Signed-off-by: Blake Ramsdell <blaker@gmail.com>\n>> > ---\n>> >  Makefile |    4 +++-\n>> >  1 files changed, 3 insertions(+), 1 deletions(-)\n>> >\n>> > diff --git a/Makefile b/Makefile\n>> > index 71479a2..5d83756 100644\n>> > --- a/Makefile\n>> > +++ b/Makefile\n>> > @@ -401,7 +401,9 @@ endif\n>> >  ifeq ($(uname_S),Darwin)\n>> >       NEEDS_SSL_WITH_CRYPTO = YesPlease\n>> >       NEEDS_LIBICONV = YesPlease\n>> > -     OLD_ICONV = UnfortunatelyYes\n>> > +     ifneq ($(uname_R),9.0.0)\n>> > +             OLD_ICONV = UnfortunatelyYes\n>> > +     endif\n>> >       NO_STRLCPY = YesPlease\n>> >       NO_MEMMEM = YesPlease\n>> >  endif\n>>\n>> I do not have an access to a Darwin box, but do you mean 10.5\n>> gives 9.0.0 as uname_R?\n>\n> Further, that comparison is going to fail as soon as the next revision\n> of Darwin (9.0.1, etc.) is released.\n\nCan we do something intelligent with $(shell iconv --version)\nthere instead, I wonder, then?\n"},{"id":"57968","messageId":"ee77f5c20711020423t6ce58818gcc5220b6427ded1@mail.gmail.com","threadId":"10583","inReplyTo":"7vbqad3pjw.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] Mac OS X 10.5 does not require the OLD_ICONV flag set","fromName":"David Symonds","fromEmail":"dsymonds@gmail.com","sentAt":"2007-11-02T11:23:51Z","receivedAt":"2007-11-02T11:23:51Z","isPatch":true,"sender":{"key":"dsymonds@gmail.com","avatar":"https://gravatar.com/avatar/b22f5051cbfc11836e36cf7a690e6cde4e225d835e13295ff98d15c7a9ee3c0f?d=mp&s=160"},"body":"On 11/2/07, Junio C Hamano <gitster@pobox.com> wrote:\n> \"David Symonds\" <dsymonds@gmail.com> writes:\n>\n> > Further, that comparison is going to fail as soon as the next revision\n> > of Darwin (9.0.1, etc.) is released.\n>\n> Can we do something intelligent with $(shell iconv --version)\n> there instead, I wonder, then?\n\nIt would probably be most appropriate for the autoconf script. Now\nthat I look at configure.ac, there's already a test for iconv in\nthere; is it not used?\n\n\nDave.\n"},{"id":"58027","messageId":"985966520711021303g905f638y2056219c22e5edeb@mail.gmail.com","threadId":"10583","inReplyTo":"ee77f5c20711020423t6ce58818gcc5220b6427ded1@mail.gmail.com","subject":"Re: [PATCH] Mac OS X 10.5 does not require the OLD_ICONV flag set","fromName":"Blake Ramsdell","fromEmail":"blaker@gmail.com","sentAt":"2007-11-02T20:03:05Z","receivedAt":"2007-11-02T20:03:05Z","isPatch":true,"sender":{"key":"blaker@gmail.com","avatar":"https://gravatar.com/avatar/2bfd39d25cb244dc4354573d5ca413a1adb793017b48cfa84baaf98b77be2a3b?d=mp&s=160"},"body":"On 11/2/07, David Symonds <dsymonds@gmail.com> wrote:\n> It would probably be most appropriate for the autoconf script. Now\n> that I look at configure.ac, there's already a test for iconv in\n> there; is it not used?\n\nThe crux of this problem is that the prototype for iconv in\n/usr/include/iconv.h is different between OS X 10.4 and OS X 10.5. So\nthe \"right thing\" is definitely to determine what is in the function\nprototype, and then act accordingly.\n\n>From OS X 10.4.10:\n\n#define _LIBICONV_VERSION 0x0109    /* version number: (major<<8) + minor */\n...\nextern size_t iconv (iconv_t cd, const char* * inbuf, size_t\n*inbytesleft, char* * outbuf, size_t *outbytesleft);\n\n>From OS X 10.5:\n\n#define _LIBICONV_VERSION 0x010B    /* version number: (major<<8) + minor */\n...\nsize_t iconv (iconv_t /*cd*/,\n        char ** __restrict /*inbuf*/,  size_t * __restrict /*inbytesleft*/,\n        char ** __restrict /*outbuf*/, size_t * __restrict /*outbytesleft*/);\n\nSo what happened in git is that someone put in OLD_ICONV to\ndynamically adjust the const-ness of parameter 2 to the iconv\nfunction, and the way they chose to do that is to identify the OS\n(more accurately, the kernel), and then I went and furthered that by\nidentifying the version.\n\nNow that I look at it further, it seems that yanking OLD_ICONV\naltogether is a better approach, and to just check _LIBICONV_VERSION\nto make sure it's \"new enough\". Now, I'm not sure what that comparison\nwould be, but we know that \"later than 0x0109\" is a good start. Based\non the version difference between OS X 10.4 and 10.5 I note that there\nis only 0x010A intervening.\n\nThis strategy presumes that this const parameter was const all the way\nup to a particular point, and then stopped being const, which is\nprobably a reasonable assumption.\n\nBlake\n-- \nBlake Ramsdell | http://www.blakeramsdell.com\n"},{"id":"58058","messageId":"1194048010-65955-1-git-send-email-blaker@gmail.com","threadId":"10583","inReplyTo":"985966520711021303g905f638y2056219c22e5edeb@mail.gmail.com","subject":"[PATCH] Removed OLD_ICONV in favor of checking _LIBICONV_VERSION directly","fromName":"Blake Ramsdell","fromEmail":"blaker@gmail.com","sentAt":"2007-11-03T00:00:10Z","receivedAt":"2007-11-03T00:00:10Z","isPatch":true,"sender":{"key":"blaker@gmail.com","avatar":"https://gravatar.com/avatar/2bfd39d25cb244dc4354573d5ca413a1adb793017b48cfa84baaf98b77be2a3b?d=mp&s=160"},"body":"Signed-off-by: Blake Ramsdell <blaker@gmail.com>\n---\n Makefile |    8 --------\n utf8.c   |    2 +-\n 2 files changed, 1 insertions(+), 9 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 71479a2..96c8a73 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -95,9 +95,6 @@ all::\n #\n # Define NO_ICONV if your libc does not properly support iconv.\n #\n-# Define OLD_ICONV if your library has an old iconv(), where the second\n-# (input buffer pointer) parameter is declared with type (const char **).\n-#\n # Define NO_R_TO_GCC_LINKER if your gcc does not like \"-R/path/lib\"\n # that tells runtime paths to dynamic libraries;\n # \"-Wl,-rpath=/path/lib\" is used instead.\n@@ -401,7 +398,6 @@ endif\n ifeq ($(uname_S),Darwin)\n \tNEEDS_SSL_WITH_CRYPTO = YesPlease\n \tNEEDS_LIBICONV = YesPlease\n-\tOLD_ICONV = UnfortunatelyYes\n \tNO_STRLCPY = YesPlease\n \tNO_MEMMEM = YesPlease\n endif\n@@ -657,10 +653,6 @@ ifdef NO_ICONV\n \tBASIC_CFLAGS += -DNO_ICONV\n endif\n \n-ifdef OLD_ICONV\n-\tBASIC_CFLAGS += -DOLD_ICONV\n-endif\n-\n ifdef PPC_SHA1\n \tSHA1_HEADER = \"ppc/sha1.h\"\n \tLIB_OBJS += ppc/sha1.o ppc/sha1ppc.o\ndiff --git a/utf8.c b/utf8.c\nindex 4efef6f..a7feb4f 100644\n--- a/utf8.c\n+++ b/utf8.c\n@@ -300,7 +300,7 @@ int is_encoding_utf8(const char *name)\n  * with iconv.  If the conversion fails, returns NULL.\n  */\n #ifndef NO_ICONV\n-#ifdef OLD_ICONV\n+#if _LIBICONV_VERSION <= 0x0109\n \ttypedef const char * iconv_ibp;\n #else\n \ttypedef char * iconv_ibp;\n-- \n1.5.3.GIT\n"},{"id":"58060","messageId":"7vbqacyyx1.fsf@gitster.siamese.dyndns.org","threadId":"10583","inReplyTo":"1194048010-65955-1-git-send-email-blaker@gmail.com","subject":"Re: [PATCH] Removed OLD_ICONV in favor of checking _LIBICONV_VERSION directly","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-11-03T00:07:22Z","receivedAt":"2007-11-03T00:07:22Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Blake Ramsdell <blaker@gmail.com> writes:\n\n> diff --git a/utf8.c b/utf8.c\n> index 4efef6f..a7feb4f 100644\n> --- a/utf8.c\n> +++ b/utf8.c\n> @@ -300,7 +300,7 @@ int is_encoding_utf8(const char *name)\n>   * with iconv.  If the conversion fails, returns NULL.\n>   */\n>  #ifndef NO_ICONV\n> -#ifdef OLD_ICONV\n> +#if _LIBICONV_VERSION <= 0x0109\n>  \ttypedef const char * iconv_ibp;\n>  #else\n>  \ttypedef char * iconv_ibp;\n\nDoes everybody's iconv use the same _LIBICONV_VERSION scheme?\n\nCompiling this:\n\n        #include <iconv.h>\n        int i = _LIBICONV_VERSION;\n\non a Linux box with GNU C library gives:\n\n\ti.c:3: error: '_LIBICONV_VERSION' undeclared here (not in a function)\n\nhere.\n"},{"id":"58061","messageId":"985966520711021721i6345e4bfv8a016a1528ee4e23@mail.gmail.com","threadId":"10583","inReplyTo":"7vbqacyyx1.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] Removed OLD_ICONV in favor of checking _LIBICONV_VERSION directly","fromName":"Blake Ramsdell","fromEmail":"blaker@gmail.com","sentAt":"2007-11-03T00:21:48Z","receivedAt":"2007-11-03T00:21:48Z","isPatch":true,"sender":{"key":"blaker@gmail.com","avatar":"https://gravatar.com/avatar/2bfd39d25cb244dc4354573d5ca413a1adb793017b48cfa84baaf98b77be2a3b?d=mp&s=160"},"body":"On 11/2/07, Junio C Hamano <gitster@pobox.com> wrote:\n> Does everybody's iconv use the same _LIBICONV_VERSION scheme?\n\nApparently not. And furthermore, my assumption about the version\nnumber being tied to the function prototype was not valid -- I have a\nDarwinPorts iconv.h that is version 0x010B but uses const for the\nsecond parameter.\n\nSorry for the mess. Let me try and come up with another plan. That\nDarwin version check doesn't seem so bad now ;).\n\nBlake\n-- \nBlake Ramsdell | http://www.blakeramsdell.com\n"}]}