Skip to content

Commit

Permalink
gh-129288: Expose socket.BDADDR_BREDR, socket.BDADDR_LE_PUBLIC, socke…
Browse files Browse the repository at this point in the history
…t.BDADDR_RANDOM only if defined for target

Add check that BDADDR_BREDR is defined as Windows build may set USE_BLUETOOTH but not BDADDR_*
  • Loading branch information
themadinventor committed Jan 25, 2025
1 parent 702f477 commit d45523c
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions Modules/socketmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -7750,12 +7750,14 @@ socket_exec(PyObject *m)
#endif /* BTPROTO_RFCOMM */
ADD_STR_CONST(m, "BDADDR_ANY", "00:00:00:00:00:00");
ADD_STR_CONST(m, "BDADDR_LOCAL", "00:00:00:FF:FF:FF");
#ifdef BTPROTO_SCO
ADD_INT_MACRO(m, BTPROTO_SCO);
#endif /* BTPROTO_SCO */
#ifdef BDADDR_BREDR
ADD_INT_MACRO(m, BDADDR_BREDR);
ADD_INT_MACRO(m, BDADDR_LE_PUBLIC);
ADD_INT_MACRO(m, BDADDR_LE_RANDOM);
#endif /* BDADDR_BREDR */
#ifdef BTPROTO_SCO
ADD_INT_MACRO(m, BTPROTO_SCO);
#endif /* BTPROTO_SCO */
#endif /* USE_BLUETOOTH */

#ifdef AF_CAN
Expand Down

0 comments on commit d45523c

Please sign in to comment.