Skip to content
Snippets Groups Projects
Commit 18a18165 authored by Dmitriy A. Gerasimov's avatar Dmitriy A. Gerasimov
Browse files
parents 6962237a ce80afd6
No related branches found
No related tags found
1 merge request!24Support 3689
......@@ -54,6 +54,7 @@ if(WIN32)
add_definitions ("-D_POSIX_")
add_definitions ("-D_POSIX_THREAD_SAFE_FUNCTIONS")
add_definitions ("-DNODE_NETNAME=\"cellframe\"")
add_compile_definitions(_GNU_SOURCE)
include_directories(../libdap/src/win32/)
include_directories(../3rdparty/wepoll/include/)
include_directories(../3rdparty/uthash/src/)
......
......@@ -36,6 +36,7 @@ along with any CellFrame SDK based project. If not, see <http://www.gnu.org/lic
#include "win32/ip.h"
#include "win32/iphdr.h"
#define s6_addr32 s6_addr
#define herror perror
#endif
......
......@@ -36,8 +36,6 @@
#include "win32/ip.h"
#include "win32/iphdr.h"
#define __in6_u _S6_un
#define __u6_addr32 _S6_u8
#endif
......
......@@ -160,8 +160,11 @@ int wait_node_ping(pthread_t l_thread, int timeout_ms)
timeout_ms *= 1000;
l_wait_time.tv_sec += timeout_ms / DAP_USEC_PER_SEC;
l_wait_time.tv_nsec += 1000 * (timeout_ms % DAP_USEC_PER_SEC);
#ifndef _WIN32
int res = pthread_timedjoin_np(l_thread, (void **) &l_ping_time, &l_wait_time);
#else
int res = pthread_join(l_thread, (void **) &l_ping_time);
#endif
if(res == ETIMEDOUT) {
pthread_kill(l_thread, 3); // SIGQUIT SIGABRT
}
......
......@@ -20,7 +20,11 @@
*/
#pragma once
#ifndef _WIN32
#include <netinet/in.h>
#else
#include <windows.h>
#endif
#include <pthread.h>
// start sending ping
......
......@@ -7,7 +7,18 @@
#include <stdint.h>
#include <stdlib.h>
#ifndef _WIN32
#include <netinet/ip.h>
#else
#include <winsock2.h>
#include <windows.h>
#include <mswsock.h>
#include <ws2tcpip.h>
#include <io.h>
#include "win32/iphdr.h"
#include "win32/ip.h"
#define uid_t uint32_t
#endif
#include <setjmp.h>
#ifdef __cplusplus
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment