#include "disgrace.h" #if defined(OS_WINDOWS) #include #include #if defined(MSVC_COMPILER) #pragma comment(lib, "Ws2_32.lib") #endif enum { D_TYPE_TCP, D_TYPE_UDP }; typedef struct DHandle { u64 type; } DHandle; b32 d_init(void) { WSADATA data; int error; if (WSAStartup(MAKEWORD(2, 2), &data)) { error = WSAGetLastError(); cyn_log_write_cstring(CYN_LOG_ERROR, (u8*) "WsaStartup failed, code: %d.", (s64)error); return false; } return true; } #include "d_tcp_win.c" #include "d_udp_win.c" #elif defined(OS_LINUX) b32 d_init(void) { return true; } #error "Linux todo" #include "d_udp_linux.c" #else #error "unknown platform" #endif