1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-06-20 00:15:31 +00:00

[windows] Less number of warnings

This commit is contained in:
Witold Filipczyk 2023-11-08 12:28:00 +01:00
parent 3aed9a8fda
commit 1042755f7f
7 changed files with 48 additions and 1 deletions

View File

@ -831,6 +831,9 @@
/* Define to 1 if you have the <windows.h> header file. */
#mesondefine HAVE_WINDOWS_H
/* Define to 1 if you have the <winsock2.h> header file. */
#mesondefine HAVE_WINSOCK2_H
/* Define to 1 if you have the <ws2tcpip.h> header file. */
#mesondefine HAVE_WS2TCPIP_H

View File

@ -318,6 +318,10 @@ if compiler.has_header('windows.h')
conf_data.set('HAVE_WINDOWS_H', 1)
endif
if compiler.has_header('winsock2.h')
conf_data.set('HAVE_WINSOCK2_H', 1)
endif
if compiler.has_header('ws2tcpip.h')
conf_data.set('HAVE_WS2TCPIP_H', 1)
endif

View File

@ -44,6 +44,9 @@
#endif
#else /* WIN32 */
#define WIN32_LEAN_AND_MEAN
#ifdef HAVE_WINSOCK2_H
#include <winsock2.h>
#endif
#include <windows.h>
#endif

View File

@ -1,9 +1,12 @@
#ifndef EL__OSDEP_WIN32_OVERRIDES_H
#define EL__OSDEP_WIN32_OVERRIDES_H
#ifdef CONFIG_OS_WIN32
#ifdef HAVE_WINSOCK2_H
#include <winsock2.h>
#endif
#ifdef HAVE_WINDOWS_H
#include <windows.h>
#endif

View File

@ -33,14 +33,37 @@
/* Misc defines */
#define IN_LOOPBACKNET 127
#ifndef EADDRINUSE
#define EADDRINUSE WSAEADDRINUSE
#endif
#ifndef EAFNOSUPPORT
#define EAFNOSUPPORT WSAEAFNOSUPPORT
#endif
#ifndef EALREADY
#define EALREADY WSAEALREADY
#endif
#ifndef ECONNREFUSED
#define ECONNREFUSED WSAECONNREFUSED
#endif
#ifndef ECONNRESET
#define ECONNRESET WSAECONNRESET
#endif
#ifndef EINPROGRESS
#define EINPROGRESS WSAEINPROGRESS
#endif
#ifndef EWOULDBLOCK
#define EWOULDBLOCK WSAEWOULDBLOCK
#endif
#ifndef ENETUNREACH
#define ENETUNREACH WSAENETUNREACH
#endif
#endif
#endif

View File

@ -3,6 +3,10 @@
#ifdef CONFIG_OS_WIN32
#ifdef HAVE_WINSOCK2_H
#include <winsock2.h>
#endif
#ifdef HAVE_WINDOWS_H
#include <windows.h>
#endif

View File

@ -7,7 +7,14 @@
/* Get SHGFP_TYPE_CURRENT from <shlobj.h>. */
#define _WIN32_IE 0x500
#ifdef HAVE_WINSOCK2_H
#include <winsock2.h>
#endif
#ifdef HAVE_WINDOWS_H
#include <windows.h>
#endif
#include <shlobj.h>
#include "osdep/system.h"