Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
3e85dfd1
Commit
3e85dfd1
authored
Oct 17, 2010
by
Gregory P. Smith
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
applying netbsd-wizs-mod.patch from issue5510 -
fixes for netbsd (and dragonflybsd?)
parent
b603d03f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
2 deletions
+25
-2
Modules/socketmodule.c
Modules/socketmodule.c
+25
-2
No files found.
Modules/socketmodule.c
View file @
3e85dfd1
...
...
@@ -379,7 +379,7 @@ dup_socket(SOCKET handle)
#define SOCKETCLOSE close
#endif
#if (defined(HAVE_BLUETOOTH_H) || defined(HAVE_BLUETOOTH_BLUETOOTH_H)) && !defined(__NetBSD__)
#if (defined(HAVE_BLUETOOTH_H) || defined(HAVE_BLUETOOTH_BLUETOOTH_H)) && !defined(__NetBSD__)
&& !defined(__DragonFly__)
#define USE_BLUETOOTH 1
#if defined(__FreeBSD__)
#define BTPROTO_L2CAP BLUETOOTH_PROTO_L2CAP
...
...
@@ -393,11 +393,13 @@ dup_socket(SOCKET handle)
#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)
#elif defined(__NetBSD__)
#elif defined(__NetBSD__)
|| defined(__DragonFly__)
#define sockaddr_l2 sockaddr_bt
#define sockaddr_rc sockaddr_bt
#define sockaddr_hci sockaddr_bt
#define sockaddr_sco sockaddr_bt
#define SOL_HCI BTPROTO_HCI
#define HCI_DATA_DIR SO_HCI_DIRECTION
#define _BT_L2_MEMB(sa, memb) ((sa)->bt_##memb)
#define _BT_RC_MEMB(sa, memb) ((sa)->bt_##memb)
#define _BT_HCI_MEMB(sa, memb) ((sa)->bt_##memb)
...
...
@@ -1113,9 +1115,13 @@ makesockaddr(SOCKET_T sockfd, struct sockaddr *addr, size_t addrlen, int proto)
case
BTPROTO_HCI
:
{
struct
sockaddr_hci
*
a
=
(
struct
sockaddr_hci
*
)
addr
;
#if defined(__NetBSD__) || defined(__DragonFly__)
return
makebdaddr
(
&
_BT_HCI_MEMB
(
a
,
bdaddr
));
#else
PyObject
*
ret
=
NULL
;
ret
=
Py_BuildValue
(
"i"
,
_BT_HCI_MEMB
(
a
,
dev
));
return
ret
;
#endif
}
#if !defined(__FreeBSD__)
...
...
@@ -1399,12 +1405,25 @@ getsockaddrarg(PySocketSockObject *s, PyObject *args,
case
BTPROTO_HCI
:
{
struct
sockaddr_hci
*
addr
=
(
struct
sockaddr_hci
*
)
addr_ret
;
#if defined(__NetBSD__) || defined(__DragonFly__)
char
*
straddr
=
PyBytes_AS_STRING
(
args
);
_BT_HCI_MEMB
(
addr
,
family
)
=
AF_BLUETOOTH
;
if
(
straddr
==
NULL
)
{
PyErr_SetString
(
socket_error
,
"getsockaddrarg: "
"wrong format"
);
return
0
;
}
if
(
setbdaddr
(
straddr
,
&
_BT_HCI_MEMB
(
addr
,
bdaddr
))
<
0
)
return
0
;
#else
_BT_HCI_MEMB
(
addr
,
family
)
=
AF_BLUETOOTH
;
if
(
!
PyArg_ParseTuple
(
args
,
"i"
,
&
_BT_HCI_MEMB
(
addr
,
dev
)))
{
PyErr_SetString
(
socket_error
,
"getsockaddrarg: "
"wrong format"
);
return
0
;
}
#endif
*
len_ret
=
sizeof
*
addr
;
return
1
;
}
...
...
@@ -4544,9 +4563,13 @@ PyInit__socket(void)
PyModule_AddIntConstant
(
m
,
"BTPROTO_L2CAP"
,
BTPROTO_L2CAP
);
PyModule_AddIntConstant
(
m
,
"BTPROTO_HCI"
,
BTPROTO_HCI
);
PyModule_AddIntConstant
(
m
,
"SOL_HCI"
,
SOL_HCI
);
#if !defined(__NetBSD__) && !defined(__DragonFly__)
PyModule_AddIntConstant
(
m
,
"HCI_FILTER"
,
HCI_FILTER
);
#endif
#if !defined(__FreeBSD__)
#if !defined(__NetBSD__) && !defined(__DragonFly__)
PyModule_AddIntConstant
(
m
,
"HCI_TIME_STAMP"
,
HCI_TIME_STAMP
);
#endif
PyModule_AddIntConstant
(
m
,
"HCI_DATA_DIR"
,
HCI_DATA_DIR
);
PyModule_AddIntConstant
(
m
,
"BTPROTO_SCO"
,
BTPROTO_SCO
);
#endif
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment