]> WPIA git - cassiopeia.git/blobdiff - src/util.h
fix: use correct prepared statement for writing logs
[cassiopeia.git] / src / util.h
index 04448d402d6ccfb6bd87b721d11c9962931e0ecc..766f7ca3f117aecc447044e8e0d32a5745f5e746 100644 (file)
@@ -13,4 +13,16 @@ std::pair<bool, std::time_t> parseDate( const std::string& date );
 std::pair<bool, std::time_t> parseMonthInterval( std::time_t t, const std::string& date );
 std::pair<bool, std::time_t> parseYearInterval( std::time_t t, const std::string& date );
 
-std::shared_ptr<std::ofstream> openLogfile( const std::string name );
+std::unique_ptr<std::ofstream> openLogfile( const std::string& name );
+
+#if __GNUC__ >= 5 || (__GNUC__ == 4 && __GNUC_MINOR__ > 8)
+#else
+namespace std {
+    template<typename T, typename... Args>
+    std::unique_ptr<T> make_unique( Args&& ... args ) {
+        return std::unique_ptr<T>( new T( std::forward<Args>( args )... ) );
+    }
+}
+#endif
+
+std::string timestamp();