Skip to content

Commit 9f51a71

Browse files
authored
Add definitions for PF_INET, PF_INET6 and PF_UNSPEC (#426)
Given there are already AF_* definitions, and they are (now) essentially synonyms, we add those definitions to enable compilation of code that already use PF_* macros.
1 parent ba5318e commit 9f51a71

File tree

3 files changed

+19
-9
lines changed

3 files changed

+19
-9
lines changed

expected/wasm32-wasi-threads/predefined-macros.txt

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@
3333
#define ADJ_TAI 0x0080
3434
#define ADJ_TICK 0x4000
3535
#define ADJ_TIMECONST 0x0020
36-
#define AF_INET 1
37-
#define AF_INET6 2
36+
#define AF_INET PF_INET
37+
#define AF_INET6 PF_INET6
3838
#define AF_UNIX 3
39-
#define AF_UNSPEC 0
39+
#define AF_UNSPEC PF_UNSPEC
4040
#define ALT_DIGITS 0x2002F
4141
#define AM_STR 0x20026
4242
#define ANYMARK 0x01
@@ -1315,6 +1315,9 @@
13151315
#define PAGE_SIZE PAGESIZE
13161316
#define PATH_MAX 4096
13171317
#define PDP_ENDIAN __PDP_ENDIAN
1318+
#define PF_INET 1
1319+
#define PF_INET6 2
1320+
#define PF_UNSPEC 0
13181321
#define PM_STR 0x20027
13191322
#define POLLERR 0x1000
13201323
#define POLLHUP 0x2000

expected/wasm32-wasi/predefined-macros.txt

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@
3333
#define ADJ_TAI 0x0080
3434
#define ADJ_TICK 0x4000
3535
#define ADJ_TIMECONST 0x0020
36-
#define AF_INET 1
37-
#define AF_INET6 2
36+
#define AF_INET PF_INET
37+
#define AF_INET6 PF_INET6
3838
#define AF_UNIX 3
39-
#define AF_UNSPEC 0
39+
#define AF_UNSPEC PF_UNSPEC
4040
#define ALT_DIGITS 0x2002F
4141
#define AM_STR 0x20026
4242
#define ANYMARK 0x01
@@ -1315,6 +1315,9 @@
13151315
#define PAGE_SIZE PAGESIZE
13161316
#define PATH_MAX 4096
13171317
#define PDP_ENDIAN __PDP_ENDIAN
1318+
#define PF_INET 1
1319+
#define PF_INET6 2
1320+
#define PF_UNSPEC 0
13181321
#define PM_STR 0x20027
13191322
#define POLLERR 0x1000
13201323
#define POLLHUP 0x2000

libc-bottom-half/headers/public/__header_sys_socket.h

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,13 @@
2525

2626
#define SO_TYPE 3
2727

28-
#define AF_UNSPEC 0
29-
#define AF_INET 1
30-
#define AF_INET6 2
28+
#define PF_UNSPEC 0
29+
#define PF_INET 1
30+
#define PF_INET6 2
31+
32+
#define AF_UNSPEC PF_UNSPEC
33+
#define AF_INET PF_INET
34+
#define AF_INET6 PF_INET6
3135
#define AF_UNIX 3
3236

3337
#ifdef __cplusplus

0 commit comments

Comments
 (0)