replace 'ifndef define' to 'pragam once'

This commit is contained in:
luwenpeng
2024-06-19 15:06:14 +08:00
parent c3fd452793
commit 48428e52fe
47 changed files with 47 additions and 188 deletions

View File

@@ -1,5 +1,4 @@
#ifndef _CHECKSUM_H
#define _CHECKSUM_H
#pragma once
#ifdef __cplusplus
extern "C"
@@ -37,5 +36,3 @@ static inline uint16_t checksum(char *data, int len)
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -1,5 +1,4 @@
#ifndef _ETH_UTILS_H
#define _ETH_UTILS_H
#pragma once
#ifdef __cplusplus
extern "C"
@@ -292,5 +291,3 @@ static inline int eth_hdr_to_str(const struct ethhdr *hdr, char *buf, size_t siz
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -1,5 +1,4 @@
#ifndef _GRE_UTILS_H
#define _GRE_UTILS_H
#pragma once
#ifdef __cplusplus
extern "C"
@@ -179,5 +178,3 @@ static inline int gre_hdr_to_str(const struct gre_hdr *hdr, char *buf, size_t si
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -1,5 +1,4 @@
#ifndef _IPV4_UTILS_H
#define _IPV4_UTILS_H
#pragma once
#ifdef __cplusplus
extern "C"
@@ -389,5 +388,3 @@ static inline int ipv4_hdr_to_str(const struct ip *hdr, char *buf, size_t size)
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -1,5 +1,4 @@
#ifndef _IPV6_UTILS_H
#define _IPV6_UTILS_H
#pragma once
#ifdef __cplusplus
extern "C"
@@ -220,5 +219,3 @@ static inline int ipv6_hdr_to_str(const struct ip6_hdr *hdr, char *buf, size_t s
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -1,5 +1,4 @@
#ifndef _L2TP_UTILS_H
#define _L2TP_UTILS_H
#pragma once
#ifdef __cplusplus
extern "C"
@@ -260,5 +259,3 @@ static inline int l2tp_hdr_to_str(const struct l2tp_hdr *hdr, char *buf, size_t
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -1,5 +1,4 @@
#ifndef _MPLS_UTILS_H
#define _MPLS_UTILS_H
#pragma once
#ifdef __cplusplus
extern "C"
@@ -83,5 +82,3 @@ static inline int mpls_label_to_str(const struct mpls_label *hdr, char *buf, siz
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -1,5 +1,4 @@
#ifndef _PACKET_PRIV_H
#define _PACKET_PRIV_H
#pragma once
#ifdef __cplusplus
extern "C"
@@ -103,5 +102,3 @@ uint64_t packet_get_hash(const struct packet *pkt, enum ldbc_method method, int
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -1,5 +1,4 @@
#ifndef _PACKET_UTILS_H
#define _PACKET_UTILS_H
#pragma once
#ifdef __cplusplus
extern "C"
@@ -55,5 +54,3 @@ void layer_convert(const struct raw_layer *in, struct layer *out);
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -1,5 +1,4 @@
#ifndef _TCP_UTILS_H
#define _TCP_UTILS_H
#pragma once
#ifdef __cplusplus
extern "C"
@@ -286,5 +285,3 @@ static inline int tcp_hdr_to_str(const struct tcphdr *hdr, char *buf, size_t siz
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -1,5 +1,4 @@
#ifndef _UDP_UTILS_H
#define _UDP_UTILS_H
#pragma once
#ifdef __cplusplus
extern "C"
@@ -89,5 +88,3 @@ static inline int udp_hdr_to_str(const struct udphdr *hdr, char *buf, size_t siz
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -1,5 +1,4 @@
#ifndef _VLAN_UTILS_H
#define _VLAN_UTILS_H
#pragma once
#ifdef __cplusplus
extern "C"
@@ -91,5 +90,3 @@ static inline int vlan_hdr_to_str(const struct vlan_hdr *hdr, char *buf, size_t
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -1,5 +1,4 @@
#ifndef _VXLAN_UTILS_H
#define _VXLAN_UTILS_H
#pragma once
#ifdef __cplusplus
extern "C"
@@ -70,5 +69,3 @@ static inline int vxlan_hdr_to_str(const struct vxlan_hdr *hdr, char *buf, size_
#ifdef __cplusplus
}
#endif
#endif