mirror of
https://github.com/drogonframework/drogon.git
synced 2025-09-30 00:01:13 -04:00
Remove non standard macros (#415)
This commit is contained in:
parent
269acbc477
commit
4f8290b589
@ -237,7 +237,9 @@ void create_model::createModelClassFromPG(
|
||||
INNER JOIN pg_type ON pg_type.oid = pg_attribute.atttypid \
|
||||
WHERE pg_class.relname = $1 and pg_constraint.contype='p'"
|
||||
<< tableName << Mode::Blocking >>
|
||||
[&](bool isNull, std::string colName, const std::string &type) {
|
||||
[&](bool isNull,
|
||||
const std::string &colName,
|
||||
const std::string &type) {
|
||||
if (isNull)
|
||||
return;
|
||||
|
||||
|
@ -80,8 +80,8 @@ class PivotTable
|
||||
public:
|
||||
PivotTable() = default;
|
||||
PivotTable(const Json::Value &json)
|
||||
: tableName_(json.get("table_name", "").asString())
|
||||
{
|
||||
tableName_ = json.get("table_name", "").asString();
|
||||
if (tableName_.empty())
|
||||
{
|
||||
throw std::runtime_error("table_name can't be empty");
|
||||
|
@ -28,26 +28,12 @@
|
||||
#define METHOD_LIST_BEGIN \
|
||||
static void initPathRouting() \
|
||||
{
|
||||
#ifndef _MSC_VER
|
||||
#define METHOD_ADD(method, pattern, filters...) \
|
||||
registerMethod(&method, pattern, {filters}, true, #method)
|
||||
|
||||
#define ADD_METHOD_TO(method, path_pattern, filters...) \
|
||||
registerMethod(&method, path_pattern, {filters}, false, #method)
|
||||
|
||||
#define ADD_METHOD_VIA_REGEX(method, regex, filters...) \
|
||||
registerMethodViaRegex(&method, regex, {filters}, #method)
|
||||
#else
|
||||
#define METHOD_ADD(method, pattern, ...) \
|
||||
registerMethod(&method, pattern, {##__VA_ARGS__}, true, #method)
|
||||
|
||||
registerMethod(&method, pattern, {__VA_ARGS__}, true, #method)
|
||||
#define ADD_METHOD_TO(method, path_pattern, ...) \
|
||||
registerMethod(&method, path_pattern, {##__VA_ARGS__}, false, #method)
|
||||
|
||||
registerMethod(&method, path_pattern, {__VA_ARGS__}, false, #method)
|
||||
#define ADD_METHOD_VIA_REGEX(method, regex, ...) \
|
||||
registerMethodViaRegex(&method, regex, {##__VA_ARGS__}, #method)
|
||||
#endif
|
||||
|
||||
registerMethodViaRegex(&method, regex, {__VA_ARGS__}, #method)
|
||||
#define METHOD_LIST_END \
|
||||
return; \
|
||||
}
|
||||
|
@ -24,12 +24,7 @@
|
||||
#define PATH_LIST_BEGIN \
|
||||
static void initPathRouting() \
|
||||
{
|
||||
#ifndef _MSC_VER
|
||||
#define PATH_ADD(path, filters...) registerSelf__(path, {filters});
|
||||
#else
|
||||
#define PATH_ADD(path, ...) registerSelf__(path, {##__VA_ARGS__});
|
||||
#endif
|
||||
|
||||
#define PATH_ADD(path, ...) registerSelf__(path, {__VA_ARGS__});
|
||||
#define PATH_LIST_END }
|
||||
namespace drogon
|
||||
{
|
||||
|
@ -27,12 +27,7 @@
|
||||
#define WS_PATH_LIST_BEGIN \
|
||||
static void initPathRouting() \
|
||||
{
|
||||
#ifndef _MSC_VER
|
||||
#define WS_PATH_ADD(path, filters...) registerSelf__(path, {filters});
|
||||
#else
|
||||
#define WS_PATH_ADD(path, ...) registerSelf__(path, {##__VA_ARGS__});
|
||||
#endif
|
||||
|
||||
#define WS_PATH_ADD(path, ...) registerSelf__(path, {__VA_ARGS__});
|
||||
#define WS_PATH_LIST_END }
|
||||
|
||||
namespace drogon
|
||||
|
@ -95,7 +95,7 @@ int main()
|
||||
for (int i = 0; i < 100; ++i)
|
||||
mapper.findByPrimaryKey(
|
||||
2,
|
||||
[](User u) { std::cout << "get a user by pk" << std::endl; },
|
||||
[](const User &u) { std::cout << "get a user by pk" << std::endl; },
|
||||
[](const DrogonDbException &e) { throw std::exception(); });
|
||||
getchar();
|
||||
}
|
||||
|
@ -163,7 +163,7 @@ void doPostgreTest(const drogon::orm::DbClientPtr &clientPtr)
|
||||
<< Mode::Blocking >>
|
||||
[&count](bool isNull,
|
||||
const std::string &name,
|
||||
std::string user_id,
|
||||
std::string &&user_id,
|
||||
int id) {
|
||||
if (!isNull)
|
||||
++count;
|
||||
@ -793,7 +793,7 @@ void doMysqlTest(const drogon::orm::DbClientPtr &clientPtr)
|
||||
<< Mode::Blocking >>
|
||||
[&count](bool isNull,
|
||||
const std::string &name,
|
||||
std::string user_id,
|
||||
std::string &&user_id,
|
||||
int id) {
|
||||
if (!isNull)
|
||||
++count;
|
||||
@ -1381,7 +1381,7 @@ void doSqliteTest(const drogon::orm::DbClientPtr &clientPtr)
|
||||
<< Mode::Blocking >>
|
||||
[&count](bool isNull,
|
||||
const std::string &name,
|
||||
std::string user_id,
|
||||
std::string &&user_id,
|
||||
int id) {
|
||||
if (!isNull)
|
||||
++count;
|
||||
|
Loading…
x
Reference in New Issue
Block a user