mirror of
https://github.com/CrowCpp/Crow.git
synced 2024-06-07 21:10:44 +00:00
Merge pull request #101 from sfinktah/sfinktah-msvc17-compat-1
fixes for **some** msvc compatibility issues
This commit is contained in:
commit
1c505df69f
@ -171,7 +171,7 @@ int main()
|
||||
});
|
||||
|
||||
// enables all log
|
||||
app.loglevel(crow::LogLevel::DEBUG);
|
||||
app.loglevel(crow::LogLevel::Debug);
|
||||
//crow::logger::setHandler(std::make_shared<ExampleLogHandler>());
|
||||
|
||||
app.port(18080)
|
||||
|
@ -92,7 +92,7 @@ int main()
|
||||
|
||||
// more json example
|
||||
app.route_dynamic("/add_json")
|
||||
.methods(crow::HTTPMethod::POST)
|
||||
.methods(crow::HTTPMethod::Post)
|
||||
([](const crow::request& req){
|
||||
auto x = crow::json::load(req.body);
|
||||
if (!x)
|
||||
@ -121,7 +121,7 @@ int main()
|
||||
});
|
||||
|
||||
// ignore all log
|
||||
crow::logger::setLogLevel(crow::LogLevel::DEBUG);
|
||||
crow::logger::setLogLevel(crow::LogLevel::Debug);
|
||||
//crow::logger::setHandler(std::make_shared<ExampleLogHandler>());
|
||||
|
||||
app.port(18080)
|
||||
|
@ -133,7 +133,7 @@ enum http_parser_type { HTTP_REQUEST, HTTP_RESPONSE, HTTP_BOTH };
|
||||
|
||||
|
||||
/* Flag values for http_parser.flags field */
|
||||
enum flags
|
||||
enum http_connection_flags
|
||||
{ F_CHUNKED = 1 << 0
|
||||
, F_CONNECTION_KEEP_ALIVE = 1 << 1
|
||||
, F_CONNECTION_CLOSE = 1 << 2
|
||||
|
@ -80,7 +80,7 @@ namespace crow
|
||||
auto last_time_t = time(0);
|
||||
tm my_tm;
|
||||
|
||||
#if defined(_MSC_VER) or defined(__MINGW32__)
|
||||
#if defined(_MSC_VER) || defined(__MINGW32__)
|
||||
gmtime_s(&my_tm, &last_time_t);
|
||||
#else
|
||||
gmtime_r(&last_time_t, &my_tm);
|
||||
|
@ -51,7 +51,7 @@ namespace crow
|
||||
|
||||
tm my_tm;
|
||||
|
||||
#if defined(_MSC_VER) or defined(__MINGW32__)
|
||||
#if defined(_MSC_VER) || defined(__MINGW32__)
|
||||
gmtime_s(&my_tm, &t);
|
||||
#else
|
||||
gmtime_r(&t, &my_tm);
|
||||
|
@ -32,8 +32,10 @@
|
||||
#define CROW_STATIC_ENDPOINT "/static/<path>"
|
||||
#endif
|
||||
|
||||
|
||||
// compiler flags
|
||||
#if defined(_MSVC_LANG) && _MSVC_LANG >= 201402L
|
||||
#define CROW_CAN_USE_CPP14
|
||||
#endif
|
||||
#if __cplusplus >= 201402L
|
||||
#define CROW_CAN_USE_CPP14
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user