diff options
Diffstat (limited to 'toxcore/tox.h')
-rw-r--r-- | toxcore/tox.h | 31 |
1 files changed, 6 insertions, 25 deletions
diff --git a/toxcore/tox.h b/toxcore/tox.h index 1f14fe46..2a26e7a6 100644 --- a/toxcore/tox.h +++ b/toxcore/tox.h | |||
@@ -36,7 +36,9 @@ | |||
36 | #include <windows.h> | 36 | #include <windows.h> |
37 | #include <ws2tcpip.h> | 37 | #include <ws2tcpip.h> |
38 | 38 | ||
39 | typedef INT sa_family_t; | 39 | /* sa_family_t is the sockaddr_in / sockaddr_in6 family field */ |
40 | typedef short sa_family_t; | ||
41 | |||
40 | #ifndef true | 42 | #ifndef true |
41 | #define true 1 | 43 | #define true 1 |
42 | #endif | 44 | #endif |
@@ -69,7 +71,6 @@ typedef union { | |||
69 | uint32_t i; | 71 | uint32_t i; |
70 | } tox_IP4; | 72 | } tox_IP4; |
71 | 73 | ||
72 | |||
73 | typedef union { | 74 | typedef union { |
74 | uint8_t uint8[16]; | 75 | uint8_t uint8[16]; |
75 | uint16_t uint16[8]; | 76 | uint16_t uint16[8]; |
@@ -83,36 +84,16 @@ typedef struct { | |||
83 | tox_IP4 ip4; | 84 | tox_IP4 ip4; |
84 | tox_IP6 ip6; | 85 | tox_IP6 ip6; |
85 | }; | 86 | }; |
86 | } tox_IPAny; | 87 | } tox_IP; |
87 | |||
88 | typedef union { | ||
89 | struct { | ||
90 | tox_IP4 ip; | ||
91 | uint16_t port; | ||
92 | /* Not used for anything right now. */ | ||
93 | uint16_t padding; | ||
94 | }; | ||
95 | uint8_t uint8[8]; | ||
96 | } tox_IP4_Port; | ||
97 | 88 | ||
98 | /* will replace IP_Port as soon as the complete infrastructure is in place | 89 | /* will replace IP_Port as soon as the complete infrastructure is in place |
99 | * removed the unused union and padding also */ | 90 | * removed the unused union and padding also */ |
100 | typedef struct { | 91 | typedef struct { |
101 | tox_IPAny ip; | 92 | tox_IP ip; |
102 | uint16_t port; | 93 | uint16_t port; |
103 | } tox_IPAny_Port; | 94 | } tox_IP_Port; |
104 | 95 | ||
105 | /* #undef TOX_ENABLE_IPV6 */ | ||
106 | #define TOX_ENABLE_IPV6 | ||
107 | #ifdef TOX_ENABLE_IPV6 | ||
108 | #define TOX_ENABLE_IPV6_DEFAULT 1 | 96 | #define TOX_ENABLE_IPV6_DEFAULT 1 |
109 | typedef tox_IPAny tox_IP; | ||
110 | typedef tox_IPAny_Port tox_IP_Port; | ||
111 | #else | ||
112 | #define TOX_ENABLE_IPV6_DEFAULT 0 | ||
113 | typedef tox_IP4 tox_IP; | ||
114 | typedef tox_IP4_Port tox_IP_Port; | ||
115 | #endif | ||
116 | 97 | ||
117 | 98 | ||
118 | /* Errors for m_addfriend | 99 | /* Errors for m_addfriend |