Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up order of includes #2015

Merged
merged 18 commits into from
Feb 7, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
FIx various build errors
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
  • Loading branch information
dthaler committed Feb 3, 2023
commit c66077448281db5dff7696ee41f54de1e9d589e3
4 changes: 4 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ IncludeCategories:
- Regex: '^<(ws2def|ws2ipdef).h>'
Priority: 2
SortPriority: 3
# ws2tcpip.h must be before mstcpip.h
- Regex: '^<ws2tcpip.h>'
Priority: 2
SortPriority: 3
- Regex: '^(<|")ElfWrapper.h'
Priority: 2
SortPriority: 4
Expand Down
1 change: 0 additions & 1 deletion ebpfapi/ebpfapi.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@
<ClInclude Include="..\libs\api\platform.h">
<DeploymentContent Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</DeploymentContent>
</ClInclude>
<ClInclude Include="pch.h" />
<ClInclude Include="resource.h" />
</ItemGroup>
<ItemGroup>
Expand Down
3 changes: 0 additions & 3 deletions ebpfapi/ebpfapi.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@
</Filter>
</ItemGroup>
<ItemGroup>
<ClInclude Include="pch.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\libs\api\platform.h">
<Filter>Header Files</Filter>
</ClInclude>
Expand Down
2 changes: 2 additions & 0 deletions include/bpf/bpf_legacy.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// SPDX-License-Identifier: MIT
#pragma once

#include "libbpf.h"

#pragma warning(push)
#pragma warning(disable : 4201) // nonstandard extension used: nameless struct/union

Expand Down
7 changes: 6 additions & 1 deletion include/bpf_helpers_platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@
// SPDX-License-Identifier: MIT
#pragma once

// This file contains platform-specific defines used by eBPF programs.
/**
* @file
* @brief This file contains platform - specific defines used by eBPF programs.
*/

#include <stdint.h>

// For eBPF programs, struct bpf_map means struct _ebpf_map_definition_in_file,
// since they use inner_map_idx and pass pointers to such structures to the various
Expand Down
4 changes: 4 additions & 0 deletions include/ebpf_structs.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
#if !defined(NO_CRT)
#include <stdbool.h>
#include <stdint.h>
#else
typedef unsigned char uint8_t;
typedef unsigned int uint32_t;
typedef unsigned long long uint64_t;
#endif

#define BPF_ENUM_TO_STRING(X) #X
Expand Down
5 changes: 5 additions & 0 deletions include/ebpf_windows.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
#ifdef _MSC_VER
#include <guiddef.h>
#else
#if !defined(NO_CRT)
#include <stdint.h>
#else
typedef unsigned char uint8_t;
#endif
typedef uint8_t GUID[16];
#endif

Expand Down
3 changes: 3 additions & 0 deletions libs/ebpfnetsh/links.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
// SPDX-License-Identifier: MIT
#pragma once

#include <windows.h>
#include <netsh.h>

#ifdef __cplusplus
extern "C"
{
Expand Down
1 change: 1 addition & 0 deletions libs/ebpfnetsh/maps.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// SPDX-License-Identifier: MIT
#pragma once

#include <windows.h>
#include <netsh.h>

#ifdef __cplusplus
Expand Down
3 changes: 3 additions & 0 deletions libs/ebpfnetsh/programs.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
// SPDX-License-Identifier: MIT
#pragma once

#include <windows.h>
#include <netsh.h>

#ifdef __cplusplus
extern "C"
{
Expand Down
1 change: 1 addition & 0 deletions tests/libs/util/socket_helper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// SPDX-License-Identifier: MIT

/**
* @file
* @brief Utility class and functions for doing socket I/O.
*/

Expand Down
2 changes: 1 addition & 1 deletion tests/libs/util/socket_helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
#define _WINSOCK_DEPRECATED_NO_WARNINGS

#include <winsock2.h>
#include <ws2tcpip.h>
#include <Mswsock.h>
#include <mstcpip.h>
#include <netiodef.h>
#include <ws2tcpip.h>

#define CLIENT_MESSAGE "request from client"
#define SERVER_MESSAGE "response from server"
Expand Down