mirror of
https://github.com/libevent/libevent.git
synced 2025-01-09 00:56:20 +08:00
move _WIN32_WINNT defintions before first #include
_WIN32_WINNT and WIN32_LEAN_AND_MEAN need to be defined before the windows.h is included for the first time. Avoid the confusion of indirect #include by defining before any.
This commit is contained in:
parent
6db587dedb
commit
a14ff91254
@ -23,12 +23,14 @@
|
|||||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
#include "evconfig-private.h"
|
|
||||||
|
|
||||||
#ifndef _WIN32_WINNT
|
#ifndef _WIN32_WINNT
|
||||||
/* Minimum required for InitializeCriticalSectionAndSpinCount */
|
/* Minimum required for InitializeCriticalSectionAndSpinCount */
|
||||||
#define _WIN32_WINNT 0x0403
|
#define _WIN32_WINNT 0x0403
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include "evconfig-private.h"
|
||||||
|
|
||||||
#include <winsock2.h>
|
#include <winsock2.h>
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include <process.h>
|
#include <process.h>
|
||||||
|
@ -23,18 +23,21 @@
|
|||||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
#include "event2/event-config.h"
|
|
||||||
#include "evconfig-private.h"
|
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
#ifndef _WIN32_WINNT
|
#ifndef _WIN32_WINNT
|
||||||
/* Minimum required for InitializeCriticalSectionAndSpinCount */
|
/* Minimum required for InitializeCriticalSectionAndSpinCount */
|
||||||
#define _WIN32_WINNT 0x0403
|
#define _WIN32_WINNT 0x0403
|
||||||
#endif
|
#endif
|
||||||
#include <winsock2.h>
|
|
||||||
#define WIN32_LEAN_AND_MEAN
|
#define WIN32_LEAN_AND_MEAN
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include "event2/event-config.h"
|
||||||
|
#include "evconfig-private.h"
|
||||||
|
|
||||||
|
#ifdef _WIN32
|
||||||
|
#include <winsock2.h>
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#undef WIN32_LEAN_AND_MEAN
|
|
||||||
#include <sys/locking.h>
|
#include <sys/locking.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
13
evutil.c
13
evutil.c
@ -24,6 +24,14 @@
|
|||||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef _WIN32
|
||||||
|
#ifndef _WIN32_WINNT
|
||||||
|
/* For structs needed by GetAdaptersAddresses */
|
||||||
|
#define _WIN32_WINNT 0x0501
|
||||||
|
#endif
|
||||||
|
#define WIN32_LEAN_AND_MEAN
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "event2/event-config.h"
|
#include "event2/event-config.h"
|
||||||
#include "evconfig-private.h"
|
#include "evconfig-private.h"
|
||||||
|
|
||||||
@ -34,15 +42,10 @@
|
|||||||
#ifdef EVENT__HAVE_AFUNIX_H
|
#ifdef EVENT__HAVE_AFUNIX_H
|
||||||
#include <afunix.h>
|
#include <afunix.h>
|
||||||
#endif
|
#endif
|
||||||
#define WIN32_LEAN_AND_MEAN
|
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#undef WIN32_LEAN_AND_MEAN
|
|
||||||
#include <io.h>
|
#include <io.h>
|
||||||
#include <tchar.h>
|
#include <tchar.h>
|
||||||
#include <process.h>
|
#include <process.h>
|
||||||
#undef _WIN32_WINNT
|
|
||||||
/* For structs needed by GetAdaptersAddresses */
|
|
||||||
#define _WIN32_WINNT 0x0501
|
|
||||||
#include <iphlpapi.h>
|
#include <iphlpapi.h>
|
||||||
#include <netioapi.h>
|
#include <netioapi.h>
|
||||||
#endif
|
#endif
|
||||||
|
11
listener.c
11
listener.c
@ -24,16 +24,19 @@
|
|||||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef _WIN32
|
||||||
|
#ifndef _WIN32_WINNT
|
||||||
|
/* Minimum required for InitializeCriticalSectionAndSpinCount */
|
||||||
|
#define _WIN32_WINNT 0x0403
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "event2/event-config.h"
|
#include "event2/event-config.h"
|
||||||
#include "evconfig-private.h"
|
#include "evconfig-private.h"
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
#ifndef _WIN32_WINNT
|
|
||||||
/* Minimum required for InitializeCriticalSectionAndSpinCount */
|
|
||||||
#define _WIN32_WINNT 0x0403
|
|
||||||
#endif
|
|
||||||
#include <winsock2.h>
|
#include <winsock2.h>
|
||||||
#include <winerror.h>
|
#include <winerror.h>
|
||||||
#include <ws2tcpip.h>
|
#include <ws2tcpip.h>
|
||||||
|
16
wepoll.c
16
wepoll.c
@ -31,6 +31,12 @@
|
|||||||
|
|
||||||
#define WEPOLL_EXPORT
|
#define WEPOLL_EXPORT
|
||||||
|
|
||||||
|
#ifndef _WIN32_WINNT
|
||||||
|
/* Minimum required for SetFileCompletionNotificationModes() */
|
||||||
|
#define _WIN32_WINNT 0x0600
|
||||||
|
#endif
|
||||||
|
#define WIN32_LEAN_AND_MEAN
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include "event-internal.h"
|
#include "event-internal.h"
|
||||||
|
|
||||||
@ -113,21 +119,11 @@ WEPOLL_EXPORT int epoll_wait(HANDLE ephnd,
|
|||||||
#define WEPOLL_INTERNAL static
|
#define WEPOLL_INTERNAL static
|
||||||
#define WEPOLL_INTERNAL_VAR static
|
#define WEPOLL_INTERNAL_VAR static
|
||||||
|
|
||||||
#ifndef WIN32_LEAN_AND_MEAN
|
|
||||||
#define WIN32_LEAN_AND_MEAN
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef __clang__
|
#ifdef __clang__
|
||||||
#pragma clang diagnostic push
|
#pragma clang diagnostic push
|
||||||
#pragma clang diagnostic ignored "-Wreserved-id-macro"
|
#pragma clang diagnostic ignored "-Wreserved-id-macro"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef _WIN32_WINNT
|
|
||||||
#undef _WIN32_WINNT
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define _WIN32_WINNT 0x0600
|
|
||||||
|
|
||||||
#ifdef __clang__
|
#ifdef __clang__
|
||||||
#pragma clang diagnostic pop
|
#pragma clang diagnostic pop
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user