Loading CMakeLists.txt +4 −0 Changes for CMakeLists.txt: 4 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -25,6 +25,10 @@ find_package(libuuidp REQUIRED) find_package(tinyxml2 REQUIRED) find_package(paritypp REQUIRED) if(APPLE OR ${CMAKE_HOST_SYSTEM_NAME} MATCHES "FreeBSD") find_package(date REQUIRED) endif() add_definitions(-D${CMAKE_HOST_SYSTEM_NAME} -DWIN32_LEAN_AND_MEAN) include_directories( Loading plugins/content/CMakeLists.txt +2 −2 Changes for plugins/content/CMakeLists.txt: 2 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -4,8 +4,8 @@ add_dependencies(content blogidev) if(${CMAKE_HOST_SYSTEM_NAME} STREQUAL "Windows") target_link_libraries(content PUBLIC blogidev authdb::client uuidp::uuidp kernel32.lib) else() target_link_libraries(content PUBLIC dl authdb::client uuidp::uuidp blogidev) elseif(APPLE OR ${CMAKE_HOST_SYSTEM_NAME} MATCHES "FreeBSD") target_link_libraries(content PUBLIC dl authdb::client uuidp::uuidp blogidev date::date-tz) endif() Loading plugins/content/content.cpp +7 −7 Changes for plugins/content/content.cpp: 7 added lines, 7 removed lines. Original line number Diff line number Diff line Loading @@ -26,7 +26,7 @@ *******************************************************************************/ #include <chrono> #ifdef FreeBSD #if defined(FreeBSD) || defined(__APPLE__) #include <date/date.h> #include <date/tz.h> #endif Loading Loading @@ -100,14 +100,14 @@ namespace blogi { sql="SELECT content.slug,content.created FROM content;"; int ncount=Args->database[tid]->exec(sql,res); for(int i=0; i<ncount; ++i){ #ifndef FreeBSD std::chrono::year_month_day cdate; std::stringstream ss(res[i][1]); std::chrono::from_stream(ss, "%Y-%m-%d", cdate); #else #if defined(FreeBSD) || defined(__APPLE__) date::year_month_day cdate; std::stringstream ss(res[i][1]); date::from_stream(ss, "%Y-%m-%d", cdate); #else std::chrono::year_month_day cdate; std::stringstream ss(res[i][1]); std::chrono::from_stream(ss, "%Y-%m-%d", cdate); #endif if (ss.fail()) { std::cerr << "Parsing failed for date: " << res[i][1] << std::endl; Loading Loading @@ -811,7 +811,7 @@ namespace blogi { try { auto now = std::chrono::system_clock::now(); #ifdef FreeBSD #if defined(FreeBSD) || defined(__APPLE__) auto local_now = date::zoned_time{date::current_zone(), now}; #else auto local_now = std::chrono::zoned_time{std::chrono::current_zone(), now}; Loading Loading
CMakeLists.txt +4 −0 Changes for CMakeLists.txt: 4 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -25,6 +25,10 @@ find_package(libuuidp REQUIRED) find_package(tinyxml2 REQUIRED) find_package(paritypp REQUIRED) if(APPLE OR ${CMAKE_HOST_SYSTEM_NAME} MATCHES "FreeBSD") find_package(date REQUIRED) endif() add_definitions(-D${CMAKE_HOST_SYSTEM_NAME} -DWIN32_LEAN_AND_MEAN) include_directories( Loading
plugins/content/CMakeLists.txt +2 −2 Changes for plugins/content/CMakeLists.txt: 2 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -4,8 +4,8 @@ add_dependencies(content blogidev) if(${CMAKE_HOST_SYSTEM_NAME} STREQUAL "Windows") target_link_libraries(content PUBLIC blogidev authdb::client uuidp::uuidp kernel32.lib) else() target_link_libraries(content PUBLIC dl authdb::client uuidp::uuidp blogidev) elseif(APPLE OR ${CMAKE_HOST_SYSTEM_NAME} MATCHES "FreeBSD") target_link_libraries(content PUBLIC dl authdb::client uuidp::uuidp blogidev date::date-tz) endif() Loading
plugins/content/content.cpp +7 −7 Changes for plugins/content/content.cpp: 7 added lines, 7 removed lines. Original line number Diff line number Diff line Loading @@ -26,7 +26,7 @@ *******************************************************************************/ #include <chrono> #ifdef FreeBSD #if defined(FreeBSD) || defined(__APPLE__) #include <date/date.h> #include <date/tz.h> #endif Loading Loading @@ -100,14 +100,14 @@ namespace blogi { sql="SELECT content.slug,content.created FROM content;"; int ncount=Args->database[tid]->exec(sql,res); for(int i=0; i<ncount; ++i){ #ifndef FreeBSD std::chrono::year_month_day cdate; std::stringstream ss(res[i][1]); std::chrono::from_stream(ss, "%Y-%m-%d", cdate); #else #if defined(FreeBSD) || defined(__APPLE__) date::year_month_day cdate; std::stringstream ss(res[i][1]); date::from_stream(ss, "%Y-%m-%d", cdate); #else std::chrono::year_month_day cdate; std::stringstream ss(res[i][1]); std::chrono::from_stream(ss, "%Y-%m-%d", cdate); #endif if (ss.fail()) { std::cerr << "Parsing failed for date: " << res[i][1] << std::endl; Loading Loading @@ -811,7 +811,7 @@ namespace blogi { try { auto now = std::chrono::system_clock::now(); #ifdef FreeBSD #if defined(FreeBSD) || defined(__APPLE__) auto local_now = date::zoned_time{date::current_zone(), now}; #else auto local_now = std::chrono::zoned_time{std::chrono::current_zone(), now}; Loading