diff options
author | David Zero <zero@cpp.edu> | 2017-01-06 04:19:12 -0800 |
---|---|---|
committer | David Zero <zero@cpp.edu> | 2017-01-06 04:20:00 -0800 |
commit | 8ef1f35ca71e39d40bdae88243534eebc6fa6a26 (patch) | |
tree | c3615a0cfb3249ed524f5aeb3c5df7511bb6d268 /toxcore | |
parent | 08cd61387ee078b81c50fa2714e9f1534a0865a2 (diff) |
Revert "Revert "Portability fixes""
This reverts commit 59e2a844f04a8725e8079f854158aa86ef5988b2, and
defines _DARWIN_C_SOURCE in toxcore/network.c
Diffstat (limited to 'toxcore')
-rw-r--r-- | toxcore/TCP_server.c | 4 | ||||
-rw-r--r-- | toxcore/network.c | 3 | ||||
-rw-r--r-- | toxcore/tox.c | 2 | ||||
-rw-r--r-- | toxcore/util.c | 2 |
4 files changed, 9 insertions, 2 deletions
diff --git a/toxcore/TCP_server.c b/toxcore/TCP_server.c index 0e2d0085..d9ace28a 100644 --- a/toxcore/TCP_server.c +++ b/toxcore/TCP_server.c | |||
@@ -619,7 +619,7 @@ static int send_routing_response(TCP_Secure_Connection *con, uint8_t rpid, const | |||
619 | */ | 619 | */ |
620 | static int send_connect_notification(TCP_Secure_Connection *con, uint8_t id) | 620 | static int send_connect_notification(TCP_Secure_Connection *con, uint8_t id) |
621 | { | 621 | { |
622 | uint8_t data[2] = {TCP_PACKET_CONNECTION_NOTIFICATION, id + NUM_RESERVED_PORTS}; | 622 | uint8_t data[2] = {TCP_PACKET_CONNECTION_NOTIFICATION, (uint8_t)(id + NUM_RESERVED_PORTS)}; |
623 | return write_packet_TCP_secure_connection(con, data, sizeof(data), 1); | 623 | return write_packet_TCP_secure_connection(con, data, sizeof(data), 1); |
624 | } | 624 | } |
625 | 625 | ||
@@ -629,7 +629,7 @@ static int send_connect_notification(TCP_Secure_Connection *con, uint8_t id) | |||
629 | */ | 629 | */ |
630 | static int send_disconnect_notification(TCP_Secure_Connection *con, uint8_t id) | 630 | static int send_disconnect_notification(TCP_Secure_Connection *con, uint8_t id) |
631 | { | 631 | { |
632 | uint8_t data[2] = {TCP_PACKET_DISCONNECT_NOTIFICATION, id + NUM_RESERVED_PORTS}; | 632 | uint8_t data[2] = {TCP_PACKET_DISCONNECT_NOTIFICATION, (uint8_t)(id + NUM_RESERVED_PORTS)}; |
633 | return write_packet_TCP_secure_connection(con, data, sizeof(data), 1); | 633 | return write_packet_TCP_secure_connection(con, data, sizeof(data), 1); |
634 | } | 634 | } |
635 | 635 | ||
diff --git a/toxcore/network.c b/toxcore/network.c index 31e8fd8b..f58cde77 100644 --- a/toxcore/network.c +++ b/toxcore/network.c | |||
@@ -21,6 +21,9 @@ | |||
21 | * | 21 | * |
22 | */ | 22 | */ |
23 | 23 | ||
24 | #define _DARWIN_C_SOURCE | ||
25 | #define _XOPEN_SOURCE 600 | ||
26 | |||
24 | #if defined(_WIN32) && _WIN32_WINNT >= _WIN32_WINNT_WINXP | 27 | #if defined(_WIN32) && _WIN32_WINNT >= _WIN32_WINNT_WINXP |
25 | #define _WIN32_WINNT 0x501 | 28 | #define _WIN32_WINNT 0x501 |
26 | #endif | 29 | #endif |
diff --git a/toxcore/tox.c b/toxcore/tox.c index 37298ce2..3276d2d5 100644 --- a/toxcore/tox.c +++ b/toxcore/tox.c | |||
@@ -21,6 +21,8 @@ | |||
21 | * | 21 | * |
22 | */ | 22 | */ |
23 | 23 | ||
24 | #define _XOPEN_SOURCE 600 | ||
25 | |||
24 | #ifdef HAVE_CONFIG_H | 26 | #ifdef HAVE_CONFIG_H |
25 | #include "config.h" | 27 | #include "config.h" |
26 | #endif | 28 | #endif |
diff --git a/toxcore/util.c b/toxcore/util.c index 7a390ea9..1d2a85dc 100644 --- a/toxcore/util.c +++ b/toxcore/util.c | |||
@@ -22,6 +22,8 @@ | |||
22 | * along with Tox. If not, see <http://www.gnu.org/licenses/>. | 22 | * along with Tox. If not, see <http://www.gnu.org/licenses/>. |
23 | */ | 23 | */ |
24 | 24 | ||
25 | #define _XOPEN_SOURCE 600 | ||
26 | |||
25 | #ifdef HAVE_CONFIG_H | 27 | #ifdef HAVE_CONFIG_H |
26 | #include "config.h" | 28 | #include "config.h" |
27 | #endif | 29 | #endif |