Export some symbols for Windows (#1088)

This commit is contained in:
An Tao 2021-11-24 23:59:00 +08:00 committed by GitHub
parent df331c8a74
commit 895552dcae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 31 additions and 7 deletions

View File

@ -14,6 +14,7 @@
#pragma once
#include <atomic>
#include <thread>
#include <iostream>
namespace drogon
{
@ -168,5 +169,26 @@ enum class WebSocketMessageType
Close,
Unknown
};
inline std::ostream &operator<<(std::ostream &out, drogon::ReqResult result)
{
switch (result)
{
case ReqResult::Ok:
return out << "OK";
case ReqResult::BadResponse:
return out << "Bad response from server";
case ReqResult::NetworkFailure:
return out << "Network failure";
case ReqResult::BadServerAddress:
return out << "Bad server address";
case ReqResult::Timeout:
return out << "Timeout";
case ReqResult::HandshakeError:
return out << "Handshake error";
case ReqResult::InvalidCertificate:
return out << "Invalid certificate";
default:
return out << "Unknown error";
}
}
} // namespace drogon

View File

@ -28,8 +28,8 @@
#include <algorithm>
#ifdef _WIN32
#include <time.h>
char *strptime(const char *s, const char *f, struct tm *tm);
time_t timegm(struct tm *tm);
DROGON_EXPORT char *strptime(const char *s, const char *f, struct tm *tm);
DROGON_EXPORT time_t timegm(struct tm *tm);
#endif
namespace drogon
{

View File

@ -256,15 +256,17 @@ class DROGON_EXPORT Criteria
}
private:
friend const Criteria operator&&(Criteria cond1, Criteria cond2);
friend DROGON_EXPORT const Criteria operator&&(Criteria cond1,
Criteria cond2);
friend const Criteria operator||(Criteria cond1, Criteria cond2);
friend DROGON_EXPORT const Criteria operator||(Criteria cond1,
Criteria cond2);
std::string conditionString_;
std::function<void(internal::SqlBinder &)> outputArgumentsFunc_;
}; // namespace orm
const Criteria operator&&(Criteria cond1, Criteria cond2);
const Criteria operator||(Criteria cond1, Criteria cond2);
DROGON_EXPORT const Criteria operator&&(Criteria cond1, Criteria cond2);
DROGON_EXPORT const Criteria operator||(Criteria cond1, Criteria cond2);
} // namespace orm
} // namespace drogon