This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Add socklen_t probe; Configure maintenance.
[perl5.git] / pp_sys.c
index f9db38e..d5c5426 100644 (file)
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -118,12 +118,17 @@ extern int h_errno;
 #   define vfork fork
 #endif
 
-/* Put this after #includes because <unistd.h> defines _XOPEN_*. */
+/* Put this after #includes because <unistd.h> defines _XOPEN_*.
+ * Sock_size_t is defined identically in doio.c. */
 #ifndef Sock_size_t
-#  if _XOPEN_VERSION >= 5 || defined(_XOPEN_SOURCE_EXTENDED) || defined(__GLIBC__)
-#    define Sock_size_t Size_t
+#  ifdef HAS_SOCKLEN_T
+#      define Sock_size_t socklen_t
 #  else
-#    define Sock_size_t int
+#      if _XOPEN_VERSION >= 5 || defined(_XOPEN_SOURCE_EXTENDED) || defined(__GLIBC__)
+#          define Sock_size_t Size_t
+#      else
+#          define Sock_size_t int
+#      endif
 #  endif
 #endif