Skip to content

Commit 3dbdced

Browse files
committed
Avoid reserved keyword and include next warnings
1 parent a7de658 commit 3dbdced

4 files changed

Lines changed: 12 additions & 11 deletions

File tree

cpp2rust/compat/arpa/inet.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@
88
#undef htonl
99
#undef htons
1010

11-
uint32_t __cpp2rust_ntohl(uint32_t x);
12-
uint16_t __cpp2rust_ntohs(uint16_t x);
13-
uint32_t __cpp2rust_htonl(uint32_t x);
14-
uint16_t __cpp2rust_htons(uint16_t x);
11+
uint32_t cpp2rust_ntohl(uint32_t x);
12+
uint16_t cpp2rust_ntohs(uint16_t x);
13+
uint32_t cpp2rust_htonl(uint32_t x);
14+
uint16_t cpp2rust_htons(uint16_t x);
1515

16-
#define ntohl(x) __cpp2rust_ntohl(x)
17-
#define ntohs(x) __cpp2rust_ntohs(x)
18-
#define htonl(x) __cpp2rust_htonl(x)
19-
#define htons(x) __cpp2rust_htons(x)
16+
#define ntohl(x) cpp2rust_ntohl(x)
17+
#define ntohs(x) cpp2rust_ntohs(x)
18+
#define htonl(x) cpp2rust_htonl(x)
19+
#define htons(x) cpp2rust_htons(x)

cpp2rust/compat/assert.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@
99
#include <stdbool.h>
1010
#endif
1111

12-
void __cpp2rust_assert_fail(bool condition) __attribute__((noreturn));
12+
void cpp2rust_assert_fail(bool condition) __attribute__((noreturn));
1313

14-
#define assert(expr) __cpp2rust_assert_fail(expr)
14+
#define assert(expr) cpp2rust_assert_fail(expr)

cpp2rust/compat/platform_flags.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ static inline std::vector<std::string> getPlatformClangFlags() {
1111
"-resource-dir=" CLANG_RESOURCE_DIR,
1212
"-I" COMPAT_INCLUDE_DIR,
1313
"-D_FORTIFY_SOURCE=0",
14+
"-Wno-gnu-include-next",
1415
};
1516
#ifdef MACOS_SDK_PATH
1617
flags.push_back("-isysroot" MACOS_SDK_PATH);

rules/assert/src.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44
#include <assert.h>
55

66
void f1(bool condition) {
7-
return __cpp2rust_assert_fail(condition);
7+
return cpp2rust_assert_fail(condition);
88
}

0 commit comments

Comments
 (0)