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

Add error code to string conversions

parent a08f619a
No related branches found
No related tags found
No related merge requests found
Pipeline #2133 failed
#pragma once
/// @file
/// @brief Include for error to string conversions
#include <curl/curl.h>
namespace coeurl {
const char* to_string(CURLcode c);
const char* to_string(CURLUcode c);
const char* to_string(CURLMcode c);
const char* to_string(CURLSHcode c);
};
#include <coeurl/errors.hpp>
const char* coeurl::to_string(CURLcode c) {
return curl_easy_strerror(c);
}
const char* coeurl::to_string(CURLUcode c) {
return curl_url_strerror(c);
}
const char* coeurl::to_string(CURLMcode c) {
return curl_multi_strerror(c);
}
const char* coeurl::to_string(CURLSHcode c) {
return curl_share_strerror(c);
}
......@@ -94,14 +94,14 @@ if target_machine.system() == 'windows'
]
endif
lib = library('coeurl', ['lib/client.cpp', 'lib/request.cpp'],
lib = library('coeurl', ['lib/client.cpp', 'lib/request.cpp', 'lib/errors.cpp'],
include_directories: include,
cpp_args : defines,
dependencies: deps,
version: meson.project_version(),
install : true)
install_headers('include/coeurl/headers.hpp', 'include/coeurl/client.hpp', 'include/coeurl/request.hpp', subdir : 'coeurl')
install_headers('include/coeurl/headers.hpp', 'include/coeurl/client.hpp', 'include/coeurl/request.hpp', 'include/coeurl/errors.hpp', subdir : 'coeurl')
coeurl_dep = declare_dependency(include_directories: include, link_with: lib, dependencies: deps)
meson.override_dependency('coeurl', coeurl_dep)
......
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