ed6e4c1485d4d823cf03092f81bfdab27149403d
[dpdk.git] / lib / librte_eal / windows / include / rte_windows.h
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright (c) 2020 Dmitry Kozlyuk
3  */
4
5 #ifndef _RTE_WINDOWS_H_
6 #define _RTE_WINDOWS_H_
7
8 /**
9  * @file Windows-specific facilities
10  *
11  * This file should be included by DPDK libraries and applications
12  * that need access to Windows API. It includes platform SDK headers
13  * in compatible order with proper options and defines error-handling macros.
14  */
15
16 /* Disable excessive libraries. */
17 #ifndef WIN32_LEAN_AND_MEAN
18 #define WIN32_LEAN_AND_MEAN
19 #endif
20
21 /* Must come first. */
22 #include <windows.h>
23
24 #include <basetsd.h>
25 #include <psapi.h>
26
27 /* Have GUIDs defined. */
28 #ifndef INITGUID
29 #define INITGUID
30 #endif
31 #include <initguid.h>
32
33 /**
34  * Log GetLastError() with context, usually a Win32 API function and arguments.
35  */
36 #define RTE_LOG_WIN32_ERR(...) \
37         RTE_LOG(DEBUG, EAL, RTE_FMT("GetLastError()=%lu: " \
38                 RTE_FMT_HEAD(__VA_ARGS__,) "\n", GetLastError(), \
39                 RTE_FMT_TAIL(__VA_ARGS__,)))
40
41 #endif /* _RTE_WINDOWS_H_ */