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

Resolve build error for Windows with C++20 #17

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
22 changes: 11 additions & 11 deletions libhesai/Source/include/pcap_source.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,21 +55,21 @@ struct PcapHeader {
uint32_t snaplen;
uint32_t network;
};
static_assert(sizeof(PcapHeader) == 24);
static_assert(sizeof(PcapHeader) == 24, "Size of PcapHeader must be 24");

struct PcapRecord {
uint32_t ts_sec;
uint32_t ts_usec;
uint32_t incl_len;
uint32_t orig_len;
};
static_assert(sizeof(PcapRecord) == 16);
static_assert(sizeof(PcapRecord) == 16, "Size of PcapRecord must be 16");
struct Ethernet {
uint8_t destination_MAC_address[6];
uint8_t source_MAC_address[6];
uint16_t ether_type;
};
static_assert(sizeof(Ethernet) == 14);
static_assert(sizeof(Ethernet) == 14, "Size of Ethernet must be 14");
struct PcapIPHeader {
Ethernet ether;
struct IP {
Expand All @@ -89,7 +89,7 @@ struct PcapIPHeader {
} ip;
PcapIPHeader(uint8_t protocol, uint16_t pkt_len);
};
static_assert(sizeof(PcapIPHeader::IP) == 20);
static_assert(sizeof(PcapIPHeader::IP) == 20, "Size of PcapIPHeader::IP must be 20");
struct PcapIPv6Header {
Ethernet ether;
struct IPv6 {
Expand All @@ -104,24 +104,24 @@ struct PcapIPv6Header {
} ipv6;
PcapIPv6Header(uint8_t protocol, uint16_t pkt_len);
};
static_assert(sizeof(PcapIPv6Header::IPv6) == 40);
static_assert(sizeof(PcapIPv6Header::IPv6) == 40, "Size of PcapIPv6Header::IPv6 must be 40");
struct UDP {
uint16_t source_port;
uint16_t distination_port;
uint16_t length;
uint16_t check_sum;
};
static_assert(sizeof(UDP) == 8);
static_assert(sizeof(UDP) == 8, "Size of UDP must be 8");
struct PcapUDPHeader : public PcapIPHeader {
UDP udp;
PcapUDPHeader(uint16_t pkt_len, uint16_t port = 2368);
};
static_assert(sizeof(PcapUDPHeader) == 42);
static_assert(sizeof(PcapUDPHeader) == 42, "Size of PcapUDPHeader must be 42");
struct PcapUDPv6Header : public PcapIPv6Header {
UDP udp;
PcapUDPv6Header(uint16_t pkt_len, uint16_t port = 2368);
};
static_assert(sizeof(PcapUDPv6Header) == 62);
static_assert(sizeof(PcapUDPv6Header) == 62, "Size of PcapUDPv6Header must be 62");
struct TCP {
uint16_t source_port;
uint16_t distination_port;
Expand All @@ -135,17 +135,17 @@ struct TCP {
uint16_t check_sum;
uint16_t urp;
};
static_assert(sizeof(TCP) == 20);
static_assert(sizeof(TCP) == 20, "Size of TCP must be 20");
struct PcapTCPHeader : public PcapIPHeader {
TCP tcp;
PcapTCPHeader(uint16_t pkt_len, uint16_t port = 2368);
};
static_assert(sizeof(PcapTCPHeader) == 54);
static_assert(sizeof(PcapTCPHeader) == 54, "Size of PcapTCPHeader must be 54");
struct PcapTCPv6Header : public PcapIPv6Header {
TCP tcp;
PcapTCPv6Header(uint16_t pkt_len, uint16_t port = 2368);
};
static_assert(sizeof(PcapTCPv6Header) == 74);
static_assert(sizeof(PcapTCPv6Header) == 74, "Size of PcapTCPv6Header must be 74");
#pragma pack(pop)

class PcapSource : public Source{
Expand Down
4 changes: 4 additions & 0 deletions libhesai/UdpParserGpu/include/general_parser_gpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,11 @@ ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <iostream>
#include <fstream>
#include <string>
#if __has_include(<semaphore>)
#include <semaphore>
#else
#include <semaphore.h>
#endif
#include <list>
#include <vector>
#include "lidar_types.h"
Expand Down