Skip to content

Commit

Permalink
FIx various build errors
Browse files Browse the repository at this point in the history
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
  • Loading branch information
dthaler committed Feb 3, 2023
1 parent 1abc2c5 commit 274f01f
Show file tree
Hide file tree
Showing 12 changed files with 30 additions and 6 deletions.
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

0 comments on commit 274f01f

Please sign in to comment.