Merge pull request #101 from sfinktah/sfinktah-msvc17-compat-1

fixes for **some** msvc compatibility issues
This commit is contained in:
Farook Al-Sammarraie 2021-02-12 01:54:51 +03:00 committed by GitHub
commit 1c505df69f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 9 additions and 7 deletions

View File

@ -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)

View File

@ -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)

View File

@ -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

View File

@ -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);

View File

@ -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);

View File

@ -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