Open barracuda156 opened 1 week ago
Wow, looks like a bad definition in macOS headers:
in netinet/in.h:
#define INADDR_ANY (u_int32_t)0x00000000
Probably some other header needs to be included that defines u_int32_t
... that's a strange type and not part of the normal POSIX definitions.
Probably <sys/types.h>
should be included.
I have found an earlier error like this, it is something related to macOS headers on legacy systems. This fixes it:
--- src/platform/posix/posix_udp.c 2024-09-08 06:43:34.000000000 +0800
+++ src/platform/posix/posix_udp.c 2024-10-29 09:07:16.000000000 +0800
@@ -23,6 +23,10 @@
#include <sys/socket.h>
#include <unistd.h>
+#ifdef __APPLE__
+typedef uint32_t u_int32_t;
+#endif
+
// UDP support.
// If we can suppress SIGPIPE on send, please do so.
UPD. A better fix is https://github.com/nanomsg/nng/issues/1900#issuecomment-2442961681
@gdamore Yes, you are absolutely right, including sys/types.h
before netinet/in.h
fixes it.
Environment Details
Additional context Add any other context about the problem here.