mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-09-06 16:46:11 -05:00
load libcurl at runtime (#33)
* load libcurl at runtime * add warning to file tab if curl cant be loaded
This commit is contained in:
26
src/headers/curl-helper.hpp
Normal file
26
src/headers/curl-helper.hpp
Normal file
@@ -0,0 +1,26 @@
|
||||
#pragma once
|
||||
#include <curl/curl.h>
|
||||
#include <QLibrary>
|
||||
|
||||
#if defined(WIN32)
|
||||
#define CURL_LIBRARY_NAME "libcurl.dll"
|
||||
#elif __APPLE__
|
||||
#define CURL_LIBRARY_NAME "libcurl.4.dylib"
|
||||
#else
|
||||
#define CURL_LIBRARY_NAME "libcurl.so.4"
|
||||
#endif
|
||||
|
||||
typedef CURL *(*initFunction)(void);
|
||||
typedef CURLcode (*setOptFunction)(CURL *, CURLoption, ...);
|
||||
typedef CURLcode (*performFunction)(CURL *);
|
||||
typedef void (*cleanupFunction)(CURL *);
|
||||
|
||||
extern initFunction f_curl_init;
|
||||
extern setOptFunction f_curl_setopt;
|
||||
extern performFunction f_curl_perform;
|
||||
extern cleanupFunction f_curl_cleanup;
|
||||
|
||||
extern QLibrary *loaded_curl_lib;
|
||||
|
||||
bool resolveCurl();
|
||||
bool loadCurl();
|
||||
@@ -8,6 +8,7 @@
|
||||
#include <fstream>
|
||||
#include <QDateTime>
|
||||
#include <QThread>
|
||||
#include <curl/curl.h>
|
||||
#include "utility.hpp"
|
||||
|
||||
#define DEFAULT_INTERVAL 300
|
||||
@@ -309,6 +310,7 @@ struct SwitcherData {
|
||||
FileIOData fileIO;
|
||||
IdleData idleData;
|
||||
std::vector<FileSwitch> fileSwitches;
|
||||
CURL *curl = nullptr;
|
||||
|
||||
std::vector<ExecutableSceneSwitch> executableSwitches;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user