{"thread":{"id":"18672","subject":"strbuf name conflict on Mac OS","startedAt":"2009-03-31T20:17:11Z","lastAt":"2009-03-31T21:57:59Z","messageCount":5,"participants":["Joshua Juran","Johannes Schindelin","Brian Gernhardt","Jay Soffian"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"110058","messageId":"E5D92A5D-B2CC-44CE-B117-0BB88C0E663E@gmail.com","threadId":"18672","inReplyTo":null,"subject":"strbuf name conflict on Mac OS","fromName":"Joshua Juran","fromEmail":"jjuran@gmail.com","sentAt":"2009-03-31T20:17:11Z","receivedAt":"2009-03-31T20:17:11Z","isPatch":false,"sender":{"key":"jjuran@gmail.com","avatar":null},"body":"Apple's OpenTransport.h from Universal Interfaces 3.4.2 defines its  \nown struct strbuf, with which git's collides.\n\nSince OpenTransport.h also defines some POSIX constants (such as  \nO_NONBLOCK) as enums, it's necessary to include OpenTransport.h from  \nfcntl.h (and other affected headers) so as to control the order in  \nwhich the definitions appear in the translation unit.\n\nThis is the minimal patch:\n\n\ndiff --git a/strbuf.h b/strbuf.h\nindex 89bd36e..b8f380e 100644\n--- a/strbuf.h\n+++ b/strbuf.h\n@@ -40,6 +40,8 @@\n\n  #include <assert.h>\n\n+#define strbuf git_strbuf\n+\n  extern char strbuf_slopbuf[];\n  struct strbuf {\n         size_t alloc;\n\n\nJosh\n"},{"id":"110059","messageId":"alpine.DEB.1.00.0903312222440.6616@intel-tinevez-2-302","threadId":"18672","inReplyTo":"E5D92A5D-B2CC-44CE-B117-0BB88C0E663E@gmail.com","subject":"Re: strbuf name conflict on Mac OS","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2009-03-31T20:24:45Z","receivedAt":"2009-03-31T20:24:45Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Tue, 31 Mar 2009, Joshua Juran wrote:\n\n> Apple's OpenTransport.h from Universal Interfaces 3.4.2 defines its own struct\n> strbuf, with which git's collides.\n> \n> Since OpenTransport.h also defines some POSIX constants (such as O_NONBLOCK)\n> as enums, it's necessary to include OpenTransport.h from fcntl.h (and other\n> affected headers) so as to control the order in which the definitions appear\n> in the translation unit.\n> \n> This is the minimal patch:\n> \n> \n> diff --git a/strbuf.h b/strbuf.h\n> index 89bd36e..b8f380e 100644\n> --- a/strbuf.h\n> +++ b/strbuf.h\n> @@ -40,6 +40,8 @@\n> \n> #include <assert.h>\n> \n> +#define strbuf git_strbuf\n> +\n> extern char strbuf_slopbuf[];\n> struct strbuf {\n>        size_t alloc;\n\nHow about this instead?\n\n-- snip --\ndiff --git a/Makefile b/Makefile\nindex 32d6782..370c2d9 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -659,6 +659,7 @@ ifeq ($(uname_S),SCO_SV)\n \tTAR = gtar\n endif\n ifeq ($(uname_S),Darwin)\n+\tBASIC_CFLAGS += -Dstrbuf=git_strbuf\n \tNEEDS_SSL_WITH_CRYPTO = YesPlease\n \tNEEDS_LIBICONV = YesPlease\n \tifeq ($(shell expr \"$(uname_R)\" : '[15678]\\.'),2)\n-- snap --\n\nNo need to let other platforms (and the C source) suffer...\n\nCiao,\nDscho\n"},{"id":"110061","messageId":"5ECAAD78-F8D4-4F86-A16B-C8DF483771D6@silverinsanity.com","threadId":"18672","inReplyTo":"E5D92A5D-B2CC-44CE-B117-0BB88C0E663E@gmail.com","subject":"Re: strbuf name conflict on Mac OS","fromName":"Brian Gernhardt","fromEmail":"benji@silverinsanity.com","sentAt":"2009-03-31T20:26:45Z","receivedAt":"2009-03-31T20:26:45Z","isPatch":false,"sender":{"key":"benji@silverinsanity.com","avatar":"https://gravatar.com/avatar/e06c101dbc25c68114d859b4a9ec7cf8a2c52fd2b0270ef0eac0e2e63ff22311?d=mp&s=160"},"body":"\nOn Mar 31, 2009, at 4:17 PM, Joshua Juran wrote:\n\n> Apple's OpenTransport.h from Universal Interfaces 3.4.2 defines its  \n> own struct strbuf, with which git's collides.\n>\n> Since OpenTransport.h also defines some POSIX constants (such as  \n> O_NONBLOCK) as enums, it's necessary to include OpenTransport.h from  \n> fcntl.h (and other affected headers) so as to control the order in  \n> which the definitions appear in the translation unit.\n\nJust to be clear, this is related to your work on LAMP under Classic  \nand not OS X, correct?  If so, perhaps you need to create a compat/ \nclassic_mac.h file that's included (when the correct #defines are  \nseen) from git-compat-util.h in the manner of compat/ \n{cygwin,mingw}.h.  I'm assuming that this naming conflict is not the  \nonly such you'll find and it's better to keep platform specific tweaks  \nto a single place when possible.\n\n~~ Brian\n"},{"id":"110070","messageId":"76718490903311436p5fe81ce3k31f18170d9388e8e@mail.gmail.com","threadId":"18672","inReplyTo":"alpine.DEB.1.00.0903312222440.6616@intel-tinevez-2-302","subject":"Re: strbuf name conflict on Mac OS","fromName":"Jay Soffian","fromEmail":"jaysoffian@gmail.com","sentAt":"2009-03-31T21:36:40Z","receivedAt":"2009-03-31T21:36:40Z","isPatch":false,"sender":{"key":"jaysoffian@gmail.com","avatar":"https://avatars.githubusercontent.com/u/155970?v=4"},"body":"On Tue, Mar 31, 2009 at 4:24 PM, Johannes Schindelin\n<Johannes.Schindelin@gmx.de> wrote:\n> How about this instead?\n>  ifeq ($(uname_S),Darwin)\n> +       BASIC_CFLAGS += -Dstrbuf=git_strbuf\n\nHeh, wrong platform. See Joshua's other message about porting git to\nMac OS (not Mac OS X). :-)\n\nj.\n"},{"id":"110071","messageId":"B21DA82F-5057-4C78-8400-1CEE5D4E8078@gmail.com","threadId":"18672","inReplyTo":"76718490903311436p5fe81ce3k31f18170d9388e8e@mail.gmail.com","subject":"Re: strbuf name conflict on Mac OS","fromName":"Joshua Juran","fromEmail":"jjuran@gmail.com","sentAt":"2009-03-31T21:57:59Z","receivedAt":"2009-03-31T21:57:59Z","isPatch":false,"sender":{"key":"jjuran@gmail.com","avatar":null},"body":"On Mar 31, 2009, at 2:36 PM, Jay Soffian wrote:\n\n> On Tue, Mar 31, 2009 at 4:24 PM, Johannes Schindelin\n> <Johannes.Schindelin@gmx.de> wrote:\n>> How about this instead?\n>>  ifeq ($(uname_S),Darwin)\n>> +       BASIC_CFLAGS += -Dstrbuf=git_strbuf\n>\n> Heh, wrong platform. See Joshua's other message about porting git to\n> Mac OS (not Mac OS X). :-)\n\nThat, and I'm not using make.  There's no need for this to be any  \nmore painful than necessary.  :-)\n\nI've added compat/lamp.h, following Brian's suggestion.\n\nJosh\n"}]}