Skip to content

Commit

Permalink
Add definitions for PF_INET, PF_INET6 and PF_UNSPEC (#426)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
loganek committed Jul 13, 2023
1 parent ba5318e commit 9f51a71
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 9 deletions.
9 changes: 6 additions & 3 deletions expected/wasm32-wasi-threads/predefined-macros.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@
#define ADJ_TAI 0x0080
#define ADJ_TICK 0x4000
#define ADJ_TIMECONST 0x0020
#define AF_INET 1
#define AF_INET6 2
#define AF_INET PF_INET
#define AF_INET6 PF_INET6
#define AF_UNIX 3
#define AF_UNSPEC 0
#define AF_UNSPEC PF_UNSPEC
#define ALT_DIGITS 0x2002F
#define AM_STR 0x20026
#define ANYMARK 0x01
Expand Down Expand Up @@ -1315,6 +1315,9 @@
#define PAGE_SIZE PAGESIZE
#define PATH_MAX 4096
#define PDP_ENDIAN __PDP_ENDIAN
#define PF_INET 1
#define PF_INET6 2
#define PF_UNSPEC 0
#define PM_STR 0x20027
#define POLLERR 0x1000
#define POLLHUP 0x2000
Expand Down
9 changes: 6 additions & 3 deletions expected/wasm32-wasi/predefined-macros.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@
#define ADJ_TAI 0x0080
#define ADJ_TICK 0x4000
#define ADJ_TIMECONST 0x0020
#define AF_INET 1
#define AF_INET6 2
#define AF_INET PF_INET
#define AF_INET6 PF_INET6
#define AF_UNIX 3
#define AF_UNSPEC 0
#define AF_UNSPEC PF_UNSPEC
#define ALT_DIGITS 0x2002F
#define AM_STR 0x20026
#define ANYMARK 0x01
Expand Down Expand Up @@ -1315,6 +1315,9 @@
#define PAGE_SIZE PAGESIZE
#define PATH_MAX 4096
#define PDP_ENDIAN __PDP_ENDIAN
#define PF_INET 1
#define PF_INET6 2
#define PF_UNSPEC 0
#define PM_STR 0x20027
#define POLLERR 0x1000
#define POLLHUP 0x2000
Expand Down
10 changes: 7 additions & 3 deletions libc-bottom-half/headers/public/__header_sys_socket.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,13 @@

#define SO_TYPE 3

#define AF_UNSPEC 0
#define AF_INET 1
#define AF_INET6 2
#define PF_UNSPEC 0
#define PF_INET 1
#define PF_INET6 2

#define AF_UNSPEC PF_UNSPEC
#define AF_INET PF_INET
#define AF_INET6 PF_INET6
#define AF_UNIX 3

#ifdef __cplusplus
Expand Down

0 comments on commit 9f51a71

Please sign in to comment.