[Python-checkins] r55766 - python/trunk/Modules/socketmodule.c

hyeshik.chang python-checkins at python.org
Tue Jun 5 20:16:53 CEST 2007


Author: hyeshik.chang
Date: Tue Jun  5 20:16:52 2007
New Revision: 55766

Modified:
   python/trunk/Modules/socketmodule.c
Log:
Fix build on FreeBSD.  Bluetooth HCI API in FreeBSD is quite different
from Linux's.  Just fix the build for now but the code doesn't
support the complete capability of HCI on FreeBSD yet.


Modified: python/trunk/Modules/socketmodule.c
==============================================================================
--- python/trunk/Modules/socketmodule.c	(original)
+++ python/trunk/Modules/socketmodule.c	Tue Jun  5 20:16:52 2007
@@ -363,8 +363,11 @@
 #define BTPROTO_L2CAP BLUETOOTH_PROTO_L2CAP
 #define BTPROTO_RFCOMM BLUETOOTH_PROTO_RFCOMM
 #define BTPROTO_HCI BLUETOOTH_PROTO_HCI
+#define SOL_HCI SOL_HCI_RAW
+#define HCI_FILTER SO_HCI_RAW_FILTER
 #define sockaddr_l2 sockaddr_l2cap
 #define sockaddr_rc sockaddr_rfcomm
+#define hci_dev hci_node
 #define _BT_L2_MEMB(sa, memb) ((sa)->l2cap_##memb)
 #define _BT_RC_MEMB(sa, memb) ((sa)->rfcomm_##memb)
 #define _BT_HCI_MEMB(sa, memb) ((sa)->hci_##memb)
@@ -4467,10 +4470,10 @@
 	PyModule_AddIntConstant(m, "BTPROTO_L2CAP", BTPROTO_L2CAP);
 	PyModule_AddIntConstant(m, "BTPROTO_HCI", BTPROTO_HCI);
 	PyModule_AddIntConstant(m, "SOL_HCI", SOL_HCI);
-	PyModule_AddIntConstant(m, "HCI_TIME_STAMP", HCI_TIME_STAMP);
-	PyModule_AddIntConstant(m, "HCI_DATA_DIR", HCI_DATA_DIR);
 	PyModule_AddIntConstant(m, "HCI_FILTER", HCI_FILTER);
 #if !defined(__FreeBSD__)
+	PyModule_AddIntConstant(m, "HCI_TIME_STAMP", HCI_TIME_STAMP);
+	PyModule_AddIntConstant(m, "HCI_DATA_DIR", HCI_DATA_DIR);
 	PyModule_AddIntConstant(m, "BTPROTO_SCO", BTPROTO_SCO);
 #endif
 	PyModule_AddIntConstant(m, "BTPROTO_RFCOMM", BTPROTO_RFCOMM);


More information about the Python-checkins mailing list