git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: cygwin-latest: compile errors related to sockaddr_storage, dirent->d_type and dirent->d_ino

From
Junio C Hamano <junkio@cox.net>
Date
Jan 20, 2006, 01:13 UTC
Message-ID
<7vzmlr7lc3.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<81b0412b0601180547q4a812c8xb632de6ab13a5e62@mail.gmail.com>
Alex Riesen <raa.lkml@gmail.com> writes:
> For reasons unknown, cygwin decided to use our sockaddr_storage.
> As it is redefined to sockaddr_in it'd cause compilation errors in
> cygwin headers.

Just removing "-Dsockaddr_storage=sockaddr_in" from ALL_CFLAGS seems to solve the problem for new Cygwin.

I doubt that -Dsockaddr_storage=sockaddr_in should be tied to NO_IPV6. Maybe a better approach would be something like the attached patch.

Although /usr/include/cygwin/in.h seems to have struct sockaddr_in6, getaddrinfo() and friends still do not seem to be there, so NO_IPV6 still remains in effect on Cygwin.

Comments?

-- >8 -- [PATCH] Makefile: do not assume lack of IPV6 means no sockaddr_storage.

Noticed first by Alex, that the latest Cygwin now properly has sockaddr_storage.

Signed-off-by: Junio C Hamano <junkio@cox.net>
---
 Makefile |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)
0b61a10bb258ae0971bce3e01e40a5a9e5d9537f
diff --git a/Makefile b/Makefile
index f6d9e0a..e8f4b24 100644
--- a/Makefile
+++ b/Makefile
@@ -42,6 +42,9 @@ all:
 #
 # Define NO_IPV6 if you lack IPv6 support and getaddrinfo().
 #
+# Define NO_SOCKADDR_STORAGE if your platform does not have struct
+# sockaddr_storage.
+#
 # Define COLLISION_CHECK below if you believe that SHA1's
 # 1461501637330902918203684832716283019655932542976 hashes do not give you
 # sufficient guarantee that no collisions between objects will ever happen.
@@ -342,7 +345,14 @@ ifdef NO_MMAP
 	COMPAT_OBJS += compat/mmap.o
 endif
 ifdef NO_IPV6
-	ALL_CFLAGS += -DNO_IPV6 -Dsockaddr_storage=sockaddr_in
+	ALL_CFLAGS += -DNO_IPV6
+endif
+ifdef NO_SOCKADDR_STORAGE
+ifdef NO_IPV6
+	ALL_CFLAGS += -Dsockaddr_storage=sockaddr_in
+else
+	ALL_CFLAGS += -Dsockaddr_storage=sockaddr_in6
+endif
 endif
 
 ifdef PPC_SHA1
-- 
1.1.3-gacdd
Previous: Alex RiesenNext: Alex Riesen
Message 20 of 27 in “cygwin-latest: compile errors related to sockaddr_storage, dirent->d_type and dirent->d_ino”
  1. Alex RiesenJan 18, 2006
  2. Christopher FaylorJan 19, 2006
  3. Junio C HamanoJan 19, 2006
  4. Christopher FaylorJan 19, 2006
  5. Christopher FaylorJan 19, 2006
  6. Linus TorvaldsJan 19, 2006
  7. Christopher FaylorJan 19, 2006
  8. Linus TorvaldsJan 19, 2006
  9. Christopher FaylorJan 19, 2006
  10. fsck-objects: support platforms without d_ino in struct dirent.Junio C Hamano, Jan 20, 2006
  11. Christopher FaylorJan 20, 2006
  12. Alex RiesenJan 19, 2006
  13. Christopher FaylorJan 19, 2006
  14. Alex RiesenJan 19, 2006
  15. Christopher FaylorJan 19, 2006
  16. Petr BaudisJan 19, 2006
  17. Alex RiesenJan 19, 2006
  18. Petr BaudisJan 19, 2006
  19. Alex RiesenJan 19, 2006
  20. Junio C HamanoJan 20, 2006
  21. Alex RiesenJan 20, 2006
  22. DT_UNKNOWN: do not fully trust existence of DT_UNKNOWNJunio C Hamano, Jan 20, 2006
  23. Alex RiesenJan 20, 2006
  24. Junio C HamanoJan 20, 2006
  25. Alex RiesenJan 20, 2006
  26. Junio C HamanoJan 21, 2006
  27. Alex RiesenJan 23, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.