config: Update 2 files
This commit is contained in:
4
.vscode/c_cpp_properties.json
vendored
4
.vscode/c_cpp_properties.json
vendored
@ -6,6 +6,7 @@
|
||||
"${workspaceFolder}/**",
|
||||
"${workspaceFolder}/tests/ipdemo/src",
|
||||
"${workspaceFolder}/tests/ipdemo/src/autogen",
|
||||
"${workspaceFolder}/tests/cprdemo/src",
|
||||
"/usr/local/include",
|
||||
"/usr/include",
|
||||
"/usr/include/x86_64-linux-gnu",
|
||||
@ -15,7 +16,8 @@
|
||||
"/opt/include"
|
||||
],
|
||||
"defines": [
|
||||
"DROGON_HEADERS_MISSING"
|
||||
"DROGON_HEADERS_MISSING",
|
||||
"CPR_HEADERS_MISSING"
|
||||
],
|
||||
"compilerPath": "/usr/bin/g++",
|
||||
"cStandard": "c17",
|
||||
|
21
tests/cprdemo/src/cpr_stubs.hpp
Normal file
21
tests/cprdemo/src/cpr_stubs.hpp
Normal file
@ -0,0 +1,21 @@
|
||||
#pragma once
|
||||
|
||||
#ifdef CPR_HEADERS_MISSING
|
||||
|
||||
#include <string>
|
||||
|
||||
namespace cpr {
|
||||
struct Url {
|
||||
Url(const std::string& url) : url(url) {}
|
||||
std::string url;
|
||||
};
|
||||
|
||||
struct Response {
|
||||
int status_code;
|
||||
std::string text;
|
||||
};
|
||||
|
||||
Response Get(const Url& url);
|
||||
}
|
||||
|
||||
#endif
|
@ -1,6 +1,11 @@
|
||||
#include <iostream>
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
#ifdef CPR_HEADERS_MISSING
|
||||
#include "cpr_stubs.hpp"
|
||||
#else
|
||||
#include <cpr/cpr.h>
|
||||
#endif
|
||||
|
||||
#include "version.hpp"
|
||||
#include "assert.hpp"
|
||||
|
Reference in New Issue
Block a user