Skip to content

Commit

Permalink
Merge pull request #98 from sbmlteam/fix_outputstream
Browse files Browse the repository at this point in the history
 - allow compilation without c++11
  • Loading branch information
Sarah Keating authored Nov 24, 2020
2 parents aca28dc + dde376d commit ac71857
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/sbml/xml/XMLOutputStream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit ac71857

Please sign in to comment.