Skip to content

Commit 79f7cbd

Browse files
author
Steinar H. Gunderson
committed
Bug #24710065: SPLIT MY_GLOBAL.H
Post-push fix: Unbreak Windows link test, since <windows.h> without WIN32_LEAN_AND_MEAN (which is used in MySQL, but not in the link test) pulls in <winsock.h>, which conflicts with our WS2 defines. Change-Id: I1f158b8a385719f8de0d9d516127a16b7ea7cf9a
1 parent e6bf62e commit 79f7cbd

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

include/my_byteorder.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#ifndef MY_BYTEORDER_INCLUDED
22
#define MY_BYTEORDER_INCLUDED
33

4-
/* Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved.
4+
/* Copyright (c) 2001, 2017, Oracle and/or its affiliates. All rights reserved.
55
66
This program is free software; you can redistribute it and/or modify
77
it under the terms of the GNU General Public License as published by
@@ -37,7 +37,7 @@
3737
#include <stdlib.h>
3838
#endif
3939

40-
#ifdef _WIN32
40+
#if defined(_WIN32) && defined(WIN32_LEAN_AND_MEAN)
4141
#include <winsock2.h>
4242
#endif
4343

include/my_io.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
2+
Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
33
44
This program is free software; you can redistribute it and/or modify
55
it under the terms of the GNU General Public License as published by
@@ -27,8 +27,10 @@
2727
#ifdef _WIN32
2828
/* Include common headers.*/
2929
# include <io.h> /* access(), chmod() */
30-
# include <winsock2.h>
31-
# include <ws2tcpip.h> /* SOCKET */
30+
#ifdef WIN32_LEAN_AND_MEAN
31+
#include <winsock2.h>
32+
#include <ws2tcpip.h> /* SOCKET */
33+
#endif
3234
#endif
3335

3436
#ifndef MYSQL_ABI_CHECK

include/mysql/psi/mysql_socket.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,10 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
3535
/* For socket api */
3636
#ifdef _WIN32
3737
#include <MSWSock.h>
38+
#ifdef WIN32_LEAN_AND_MEAN
3839
#include <winsock2.h>
3940
#include <ws2def.h>
41+
#endif
4042
#define SOCKBUF_T char
4143
#else
4244
#include <netinet/in.h>

0 commit comments

Comments
 (0)