[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 04/11: On Win32, prefer winsock2 header for socket decla
From: |
Mike Gran |
Subject: |
[Guile-commits] 04/11: On Win32, prefer winsock2 header for socket declarations |
Date: |
Sun, 24 Jan 2021 01:28:48 -0500 (EST) |
mike121 pushed a commit to branch mingw-guile-3.0
in repository guile.
commit b517967026f976b6ab27002c019542864c40bf7c
Author: Mike Gran <spk121@yahoo.com>
AuthorDate: Sat Jan 23 16:33:16 2021 -0800
On Win32, prefer winsock2 header for socket declarations
* libguile/posix-w32.h: prefer lowercase windows.h for MinGW cross-builds
* libguile/socket.c [HAVE_WINSOCK2_H]: use only winsock2.h for socket
declarations
---
libguile/posix-w32.h | 2 +-
libguile/socket.c | 11 ++++++++---
2 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/libguile/posix-w32.h b/libguile/posix-w32.h
index 83860ff..ba1dff2 100644
--- a/libguile/posix-w32.h
+++ b/libguile/posix-w32.h
@@ -24,7 +24,7 @@
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
-#include <Windows.h>
+#include <windows.h>
#endif
#include <string.h>
#include "libguile/scm.h"
diff --git a/libguile/socket.c b/libguile/socket.c
index 8af6f57..bcd4ab5 100644
--- a/libguile/socket.c
+++ b/libguile/socket.c
@@ -34,13 +34,18 @@
#include <string.h>
#endif
#include <unistd.h>
-#include <sys/socket.h>
#include <sys/types.h>
+
+#ifdef HAVE_WINSOCK2_H
+#include <winsock2.h>
+#else /* ! HAVE_WINSOCK2_H */
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <netinet/tcp.h>
#ifdef HAVE_UNIX_DOMAIN_SOCKETS
#include <sys/un.h>
#endif
-#include <netinet/in.h>
-#include <netinet/tcp.h>
+#endif /* ! HAVE_WINSOCK2_H */
#include <netdb.h>
#include <arpa/inet.h>
- [Guile-commits] branch mingw-guile-3.0 created (now c8990b7), Mike Gran, 2021/01/24
- [Guile-commits] 01/11: disable popen 'no duplicates' test for MinGW, Mike Gran, 2021/01/24
- [Guile-commits] 03/11: Add Win32 compatibility to JIT, Mike Gran, 2021/01/24
- [Guile-commits] 05/11: ice-9 ftw: handle missing getuid and getgid, Mike Gran, 2021/01/24
- [Guile-commits] 07/11: ftw test should handle missing symlink procedure, Mike Gran, 2021/01/24
- [Guile-commits] 04/11: On Win32, prefer winsock2 header for socket declarations,
Mike Gran <=
- [Guile-commits] 06/11: ice-9 ftw: handle non-working inodes, Mike Gran, 2021/01/24
- [Guile-commits] 08/11: Let read-line handle alternate line endings, Mike Gran, 2021/01/24
- [Guile-commits] 02/11: remove 2nd attempt at invoking ComSpec when spawning child, Mike Gran, 2021/01/24
- [Guile-commits] 09/11: Let suspendable ports' read-line handle alternate line endings, Mike Gran, 2021/01/24
- [Guile-commits] 10/11: simplify reading http headers using updated %read-line, Mike Gran, 2021/01/24
- [Guile-commits] 11/11: For MinGW use Windows filepaths in libpath.h, Mike Gran, 2021/01/24