Skip to content

Commit 907e7ce

Browse files
committed
Move cxx ffi to dcsctp_cxx namespace
To avoid polluting the default namespace.
1 parent c201a42 commit 907e7ce

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

dcsctp-cxx/examples/main.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
#include <iostream>
33

44
int main() {
5-
std::cout << "dcsctp version: " << version().c_str() << std::endl;
5+
std::cout << "dcsctp version: " << dcsctp_cxx::version().c_str() << std::endl;
66

7-
DcSctpSocket *socket = new_socket();
7+
dcsctp_cxx::DcSctpSocket *socket = dcsctp_cxx::new_socket();
88

99
if (socket) {
1010
std::cout << "Successfully created a socket." << std::endl;
@@ -13,14 +13,14 @@ int main() {
1313
return 1;
1414
}
1515

16-
if (state(*socket) == SocketState::Closed) {
16+
if (dcsctp_cxx::state(*socket) == dcsctp_cxx::SocketState::Closed) {
1717
std::cout << "Socket is initially closed" << std::endl;
1818
} else {
1919
std::cout << "Socket is in an unexpected state" << std::endl;
2020
return 1;
2121
}
2222

2323
std::cout << "Socket is about to be deleted." << std::endl;
24-
delete_socket(socket);
24+
dcsctp_cxx::delete_socket(socket);
2525
return 0;
2626
}

dcsctp-cxx/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use dcsctp::api::Options;
33
use dcsctp::api::SocketState as DcSctpSocketState;
44
use std::time::Instant;
55

6-
#[cxx::bridge]
6+
#[cxx::bridge(namespace = "dcsctp_cxx")]
77
mod ffi {
88
#[derive(Debug)]
99
enum SocketState {

0 commit comments

Comments
 (0)