Skip to content
Snippets Groups Projects
Verified Commit ba0ce649 authored by Nicolas Werner's avatar Nicolas Werner
Browse files

Some windows fixes

parent d018ae4a
No related branches found
No related tags found
No related merge requests found
Pipeline #1326 passed
......@@ -68,11 +68,11 @@ private:
void remove_request(Request *r);
void check_multi_info();
static void event_cb(int fd, short kind, void *userp);
static void timer_cb(int fd, short kind, void *userp);
static void add_pending_requests_cb(int, short, void *userp);
static void stop_ev_loop_cb(int, short, void *userp);
static void cancel_requests_cb(int, short, void *userp);
static void event_cb(evutil_socket_t fd, short kind, void *userp);
static void timer_cb(evutil_socket_t fd, short kind, void *userp);
static void add_pending_requests_cb(evutil_socket_t, short, void *userp);
static void stop_ev_loop_cb(evutil_socket_t, short, void *userp);
static void cancel_requests_cb(evutil_socket_t, short, void *userp);
static int multi_timer_cb(CURLM *multi, long timeout_ms, Client *g);
......
#pragma once
#include "client.hpp"
#include <functional>
#include <string>
#include <curl/curl.h>
#include "headers.hpp"
namespace coeurl {
struct Client;
struct Request {
enum class Method {
DELETE,
......
......@@ -66,7 +66,7 @@ int Client::multi_timer_cb(CURLM *multi, long timeout_ms, Client *g) {
}
/* Called by libevent when we get action on a multi socket */
void Client::event_cb(int fd, short kind, void *userp) {
void Client::event_cb(evutil_socket_t fd, short kind, void *userp) {
Client *g = (Client *)userp;
int action = ((kind & EV_READ) ? CURL_CSELECT_IN : 0) |
......@@ -86,7 +86,7 @@ void Client::event_cb(int fd, short kind, void *userp) {
}
/* Called by libevent when our timeout expires */
void Client::timer_cb(int, short, void *userp) {
void Client::timer_cb(evutil_socket_t, short, void *userp) {
Client::log->trace("timer_cb");
Client *g = (Client *)userp;
......@@ -98,7 +98,7 @@ void Client::timer_cb(int, short, void *userp) {
}
// Invoked when we were told to shut down.
void Client::stop_ev_loop_cb(int, short, void *userp) {
void Client::stop_ev_loop_cb(evutil_socket_t, short, void *userp) {
Client::log->trace("stop_ev_loop_cb");
Client *g = (Client *)userp;
......@@ -110,7 +110,7 @@ void Client::stop_ev_loop_cb(int, short, void *userp) {
}
/* Called by libevent when our timeout expires */
void Client::add_pending_requests_cb(int, short, void *userp) {
void Client::add_pending_requests_cb(evutil_socket_t, short, void *userp) {
Client::log->trace("add_pending_requests_cb");
Client *g = (Client *)userp;
......@@ -135,7 +135,7 @@ void Client::add_pending_requests_cb(int, short, void *userp) {
}
/* Called by libevent when our timeout expires */
void Client::cancel_requests_cb(int, short, void *userp) {
void Client::cancel_requests_cb(evutil_socket_t, short, void *userp) {
Client::log->trace("cancel_requests_cb");
Client *g = (Client *)userp;
......
#include "coeurl/request.hpp"
#include "coeurl/client.hpp"
namespace coeurl {
/* CURLOPT_WRITEFUNCTION */
size_t Request::write_cb(void *ptr, size_t size, size_t nmemb, void *data) {
......
......@@ -25,7 +25,7 @@ cmake = import('cmake')
libevent_options = cmake.subproject_options()
libevent_options.add_cmake_defines({
'CMAKE_C_FLAGS': '-fPIC',
'EVENT_LIBRARY_TYPE': 'STATIC',
'EVENT__LIBRARY_TYPE': 'STATIC',
'BUILD_SHARED_LIBS': false,
'BUILD_SHARED_AND_STATIC_LIBS': false,
'EVENT__DISABLE_OPENSSL': true,
......@@ -70,8 +70,14 @@ endif
deps += [libcurl_dep]
include = include_directories('include')
defines = []
if target_machine.system() == 'windows'
defines += '-DWIN32_LEAN_AND_MEAN'
endif
lib = library('coeurl', ['lib/client.cpp', 'lib/request.cpp'],
include_directories: include,
cpp_args : defines,
dependencies: deps,
install : true)
......
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