tweaks for Windows cmake build
This commit is contained in:
@@ -25,21 +25,19 @@
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#include <string>
|
||||
#include <inttypes.h>
|
||||
|
||||
#if defined(__linux__) || defined(__APPLE__)
|
||||
#if defined(_WIN32)
|
||||
#include <WinSock2.h>
|
||||
#include <stdint.h>
|
||||
#else
|
||||
#include <netinet/in.h>
|
||||
#include <sys/socket.h>
|
||||
#include <netdb.h>
|
||||
#include <arpa/inet.h>
|
||||
#endif
|
||||
|
||||
#if defined(__MINGW32__) || defined(__MINGW64__)
|
||||
#include <WinSock2.h>
|
||||
#include <stdint.h>
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#include "libzt.h"
|
||||
@@ -93,13 +91,13 @@ int main(int argc, char **argv)
|
||||
uint64_t nodeId = zts_get_node_id();
|
||||
DEBUG_TEST("I am %llx", nodeId);
|
||||
|
||||
sleep(5);
|
||||
|
||||
if ((sockfd = zts_socket(AF_INET6, SOCK_STREAM, 0)) < 0)
|
||||
if ((sockfd = zts_socket(AF_INET6, SOCK_STREAM, 0)) < 0) {
|
||||
DEBUG_ERROR("error creating ZeroTier socket");
|
||||
}
|
||||
|
||||
if ((err = zts_connect(sockfd, (const struct sockaddr *)&in6, sizeof(in6))) < 0)
|
||||
if ((err = zts_connect(sockfd, (const struct sockaddr *)&in6, sizeof(in6))) < 0) {
|
||||
DEBUG_ERROR("error connecting to remote host (%d)", err);
|
||||
}
|
||||
|
||||
DEBUG_TEST("sending to server...");
|
||||
w = zts_write(sockfd, msg, strlen(msg));
|
||||
|
||||
Reference in New Issue
Block a user