Skip to content

gh-132734: Fix build on FreeBSD and old Linux #132829

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions Lib/test/test_socket.py
Original file line number Diff line number Diff line change
Expand Up @@ -2647,14 +2647,13 @@ def testBluetoothConstants(self):
socket.BT_POWER
socket.BT_CHANNEL_POLICY
socket.BT_CHANNEL_POLICY_BREDR_ONLY
socket.BT_PHY
socket.BT_PHY_BR_1M_1SLOT
socket.BT_MODE
socket.BT_MODE_BASIC
socket.BT_VOICE
socket.BT_VOICE_TRANSPARENT
socket.BT_VOICE_CVSD_16BIT
socket.BT_CODEC
if hasattr(socket, 'BT_PHY'):
socket.BT_PHY_BR_1M_1SLOT
if hasattr(socket, 'BT_MODE'):
socket.BT_MODE_BASIC
if hasattr(socket, 'BT_VOICE'):
socket.BT_VOICE_TRANSPARENT
socket.BT_VOICE_CVSD_16BIT
socket.L2CAP_LM
socket.L2CAP_LM_MASTER
socket.L2CAP_LM_AUTH
Expand Down
12 changes: 11 additions & 1 deletion Modules/socketmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ shutdown(how) -- shut down traffic in one or both directions\n\
# include <sys/ioctl.h>
#endif

#ifdef HAVE_BLUETOOTH_H
#if defined(HAVE_BLUETOOTH_H) && !defined(__FreeBSD__)
# include <netbt/l2cap.h>
# include <netbt/rfcomm.h>
# include <netbt/hci.h>
Expand Down Expand Up @@ -8014,6 +8014,7 @@ socket_exec(PyObject *m)
#endif
ADD_INT_MACRO(m, BT_SNDMTU);
ADD_INT_MACRO(m, BT_RCVMTU);
#ifdef BT_PHY
ADD_INT_MACRO(m, BT_PHY);
ADD_INT_MACRO(m, BT_PHY_BR_1M_1SLOT);
ADD_INT_MACRO(m, BT_PHY_BR_1M_3SLOT);
Expand All @@ -8030,15 +8031,24 @@ socket_exec(PyObject *m)
ADD_INT_MACRO(m, BT_PHY_LE_2M_RX);
ADD_INT_MACRO(m, BT_PHY_LE_CODED_TX);
ADD_INT_MACRO(m, BT_PHY_LE_CODED_RX);
#endif
#ifdef BT_MODE
ADD_INT_MACRO(m, BT_MODE);
ADD_INT_MACRO(m, BT_MODE_BASIC);
ADD_INT_MACRO(m, BT_MODE_ERTM);
ADD_INT_MACRO(m, BT_MODE_STREAMING);
ADD_INT_MACRO(m, BT_MODE_LE_FLOWCTL);
ADD_INT_MACRO(m, BT_MODE_EXT_FLOWCTL);
#endif
#ifdef BT_PKT_STATUS
ADD_INT_MACRO(m, BT_PKT_STATUS);
#endif
#ifdef BT_ISO_QOS
ADD_INT_MACRO(m, BT_ISO_QOS);
#endif
#ifdef BT_CODEC
ADD_INT_MACRO(m, BT_CODEC);
#endif
#endif /* HAVE_BLUETOOTH_BLUETOOTH_H */
#endif /* USE_BLUETOOTH */

Expand Down
Loading