{"thread":{"id":"1355","subject":"[RFD] socklen_t needs to be defined and libssl to be linked on old Mac OS X","startedAt":"2005-07-28T14:51:41Z","lastAt":"2005-07-29T10:27:00Z","messageCount":3,"participants":["Johannes Schindelin","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"6506","messageId":"Pine.LNX.4.58.0507281649230.25783@wgmdd8.biozentrum.uni-wuerzburg.de","threadId":"1355","inReplyTo":null,"subject":"[RFD] socklen_t needs to be defined and libssl to be linked on old Mac OS X","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2005-07-28T14:51:41Z","receivedAt":"2005-07-28T14:51:41Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"\nOn older Mac OS X (10.2.8), no socklen_t is defined, and therefore\ndaemon.c does not compile. However, Mac OS X 10.4 seems to define\nsocklen_t differently.\n\nAlso, linking fails due to some symbols defined in libssl (not just\nlibcrypto).\n\nSigned-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>\n\n---\n\n Makefile |    4 ++++\n daemon.c |    3 +++\n 2 files changed, 7 insertions\n\ndiff --git a/Makefile b/Makefile\n--- a/Makefile\n+++ b/Makefile\n@@ -95,7 +95,11 @@ ifdef PPC_SHA1\n   LIB_OBJS += ppc/sha1.o ppc/sha1ppc.o\n else\n   SHA1_HEADER=<openssl/sha.h>\n+ifeq ($(shell uname -s),Darwin)\n+  LIBS += -lcrypto -lssl\n+else\n   LIBS += -lcrypto\n+endif\n endif\n endif\n\ndiff --git a/daemon.c b/daemon.c\n--- a/daemon.c\n+++ b/daemon.c\n@@ -5,6 +5,9 @@\n #include <sys/socket.h>\n #include <netinet/in.h>\n #include <arpa/inet.h>\n+#ifdef __APPLE__\n+typedef int socklen_t;\n+#endif\n\n static const char daemon_usage[] = \"git-daemon [--inetd | --port=n]\";\n"},{"id":"6538","messageId":"7vfytyqrhq.fsf@assigned-by-dhcp.cox.net","threadId":"1355","inReplyTo":"Pine.LNX.4.58.0507281649230.25783@wgmdd8.biozentrum.uni-wuerzburg.de","subject":"Re: [RFD] socklen_t needs to be defined and libssl to be linked on old Mac OS X","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-07-29T02:24:17Z","receivedAt":"2005-07-29T02:24:17Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n> On older Mac OS X (10.2.8), no socklen_t is defined, and therefore\n> daemon.c does not compile. However, Mac OS X 10.4 seems to define\n> socklen_t differently.\n>\n> Also, linking fails due to some symbols defined in libssl (not just\n> libcrypto).\n\nHmph.  While I would want things to be portable, I prefer to\navoid platform specific #ifdef and conditional Makefile\nconstructs.\n\n>    SHA1_HEADER=<openssl/sha.h>\n> +ifeq ($(shell uname -s),Darwin)\n> +  LIBS += -lcrypto -lssl\n> +else\n>    LIBS += -lcrypto\n> +endif\n>  endif\n>  #include <arpa/inet.h>\n> +#ifdef __APPLE__\n> +typedef int socklen_t;\n> +#endif\n\nI'll keep this in the proposed updates queue until somebody\ncomes up with a bit cleaner solution.\n\nBy the way, Johannes, what mailer do you use?  Many of your\npatches seem to be whitespace damaged.  For example:\n\n> diff --git a/daemon.c b/daemon.c\n> --- a/daemon.c\n> +++ b/daemon.c\n> @@ -5,6 +5,9 @@\n>  #include <sys/socket.h>\n>  #include <netinet/in.h>\n>  #include <arpa/inet.h>\n> +#ifdef __APPLE__\n> +typedef int socklen_t;\n> +#endif\n>\n>  static const char daemon_usage[] = \"git-daemon [--inetd | --port=n]\";\n\nThe empty line before daemon_usage[] line should start with a\nsingle SP but your message does not seem to have it.  I double\nchecked with the copy marc has:\n\n    http://marc.theaimsgroup.com/?l=git&m=112256286508546&q=raw\n"},{"id":"6575","messageId":"Pine.LNX.4.58.0507291225000.5849@wgmdd8.biozentrum.uni-wuerzburg.de","threadId":"1355","inReplyTo":"7vfytyqrhq.fsf@assigned-by-dhcp.cox.net","subject":"Re: [RFD] socklen_t needs to be defined and libssl to be linked on old Mac OS X","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2005-07-29T10:27:00Z","receivedAt":"2005-07-29T10:27:00Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Thu, 28 Jul 2005, Junio C Hamano wrote:\n\n> I'll keep this in the proposed updates queue until somebody\n> comes up with a bit cleaner solution.\n\nAgreed. That's why I put in \"RFD\", not \"PATCH\"\n\n> By the way, Johannes, what mailer do you use?  Many of your\n> patches seem to be whitespace damaged.\n\nWhy, I use pine! The whitespace could be the consequence of a very tired\nyours truly doing copy and paste. Anyway, this was not really meant as a\npatch, but rather as documentation of my thoughts.\n\nCiao,\nDscho\n"}]}