Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
024d20f8
Commit
024d20f8
authored
Jul 28, 2018
by
Eli Zaretskii
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix compilation with mingw.org's MinGW 5.x headers
parent
38b67488
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
3 deletions
+17
-3
lib-src/pop.c
lib-src/pop.c
+6
-2
nt/inc/ms-w32.h
nt/inc/ms-w32.h
+6
-1
nt/inc/sys/socket.h
nt/inc/sys/socket.h
+5
-0
No files found.
lib-src/pop.c
View file @
024d20f8
...
...
@@ -30,8 +30,12 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */
#include "ntlib.h"
#undef _WIN32_WINNT
#define _WIN32_WINNT 0x0501
/* for getaddrinfo stuff */
#include <winsock2.h>
#include <ws2tcpip.h>
#if defined __MINGW32_VERSION && __MINGW32_VERSION >= 5000000L
# include <windows.h>
#else
# include <winsock2.h>
#endif
# include <ws2tcpip.h>
#undef getaddrinfo
#define getaddrinfo sys_getaddrinfo
#undef freeaddrinfo
...
...
nt/inc/ms-w32.h
View file @
024d20f8
...
...
@@ -455,7 +455,12 @@ extern char *get_emacs_configuration_options (void);
windows.h. For this to have proper effect, config.h must always be
included before windows.h. */
#define _WINSOCKAPI_ 1
#define _WINSOCK_H
#if defined __MINGW32_VERSION && __MINGW32_VERSION < 5000000L
/* mingw.org's MinGW 5.x changed how it includes winsock.h and time.h,
and now defining _WINSOCK_H skips the definition of struct timeval,
which we don't want. */
# define _WINSOCK_H
#endif
/* Defines size_t and alloca (). */
#include <stdlib.h>
...
...
nt/inc/sys/socket.h
View file @
024d20f8
...
...
@@ -49,6 +49,11 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */
#define timeval ws_timeval
#endif
#if defined __MINGW32_VERSION && __MINGW32_VERSION >= 5000000L
/* Need winerror.h before winsock2.h with mingw.org's MinGW 5.x,
otherwise some error codes are not defined. */
# include <winerror.h>
#endif
#include <winsock2.h>
#include <ws2tcpip.h>
/* process.c uses uint16_t (from C99) for IPv6, but
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment