From dde376dde76579ba934c6cb5a1568df33a84a0cf Mon Sep 17 00:00:00 2001 From: "Frank T. Bergmann" Date: Tue, 24 Nov 2020 10:17:51 +0100 Subject: [PATCH] - allow compilation without c++11 --- src/sbml/xml/XMLOutputStream.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/sbml/xml/XMLOutputStream.cpp b/src/sbml/xml/XMLOutputStream.cpp index db3aad9050..5bfc44cb6c 100644 --- a/src/sbml/xml/XMLOutputStream.cpp +++ b/src/sbml/xml/XMLOutputStream.cpp @@ -993,9 +993,15 @@ XMLOutputStream::writeComment (const std::string& programName, time_t tim=time(NULL); tm *now=localtime(&tim); +#if ( __cplusplus > 201103L ) snprintf(formattedDateAndTime, 17, "%d-%02d-%02d %02d:%02d", now->tm_year+1900, now->tm_mon+1, now->tm_mday, now->tm_hour, now->tm_min); +#else + sprintf(formattedDateAndTime, "%d-%02d-%02d %02d:%02d", + now->tm_year+1900, now->tm_mon+1, now->tm_mday, + now->tm_hour, now->tm_min); +#endif mStream << " on " << formattedDateAndTime; }