Skip to content

Commit

Permalink
- allow compilation without c++11
Browse files Browse the repository at this point in the history
  • Loading branch information
fbergmann committed Nov 24, 2020
1 parent aca28dc commit dde376d
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 dde376d

Please sign in to comment.