Tor 85d6b41d on FreeBSD 12-CURRENT: error: use of undeclared identifier 'O_RDWR'

When I try to compile Tor 85d6b41d on FreeBSD 12-CURRENT, I get this build error:

neel@xb3:~/code/tor/tor % make
make  all-am
  CC       src/core/or/connection_edge.o
src/core/or/connection_edge.c:2123:36: error: use of undeclared identifier
      'O_RDWR'
  pf = tor_open_cloexec("/dev/pf", O_RDWR, 0);
                                   ^
src/core/or/connection_edge.c:2271:7: warning: implicit declaration of function
      'ioctl' is invalid in C99 [-Wimplicit-function-declaration]
  if (ioctl(pf, DIOCNATLOOK, &pnl) < 0) {
      ^
src/core/or/connection_edge.c:2271:7: warning: this function declaration is not
      a prototype [-Wstrict-prototypes]
src/core/or/connection_edge.c:2271:17: warning: implicit declaration of function
      '_IOWR' is invalid in C99 [-Wimplicit-function-declaration]
  if (ioctl(pf, DIOCNATLOOK, &pnl) < 0) {
                ^
/usr/include/net/pfvar.h:1392:21: note: expanded from macro 'DIOCNATLOOK'
#define DIOCNATLOOK     _IOWR('D', 23, struct pfioc_natlook)
                        ^
src/core/or/connection_edge.c:2271:17: warning: this function declaration is not
      a prototype [-Wstrict-prototypes]
/usr/include/net/pfvar.h:1392:21: note: expanded from macro 'DIOCNATLOOK'
#define DIOCNATLOOK     _IOWR('D', 23, struct pfioc_natlook)
                        ^
src/core/or/connection_edge.c:2271:17: error: expected expression
/usr/include/net/pfvar.h:1392:36: note: expanded from macro 'DIOCNATLOOK'
#define DIOCNATLOOK     _IOWR('D', 23, struct pfioc_natlook)
                                       ^
4 warnings and 2 errors generated.
*** Error code 1

Stop.
make[1]: stopped in /usr/home/neel/code/tor/tor
*** Error code 1

Stop.
make: stopped in /usr/home/neel/code/tor/tor
neel@xb3:~/code/tor/tor %

I will upload a patch for this shortly.