mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
Fix compiling with old GCC
This commit is contained in:
parent
d9aa37219c
commit
51c25219bb
@ -243,7 +243,6 @@
|
||||
#include <math.h>
|
||||
#include <sstream>
|
||||
#include <typeinfo>
|
||||
#include <iomanip>
|
||||
|
||||
#include "rsgxsnetservice.h"
|
||||
#include "gxssecurity.h"
|
||||
@ -262,6 +261,13 @@
|
||||
# include "deep_search/deep_search.h"
|
||||
#endif
|
||||
|
||||
#include "util/cxx11retrocompat.h"
|
||||
#if defined(GCC_VERSION) && GCC_VERSION > 50100
|
||||
# include <iomanip>
|
||||
#else
|
||||
# include <cstdio>
|
||||
#endif
|
||||
|
||||
/***
|
||||
* Use the following defines to debug:
|
||||
NXS_NET_DEBUG_0 shows group update high level information
|
||||
@ -5303,9 +5309,15 @@ bool RsGxsNetService::search( const std::string& substring,
|
||||
s.mSignFlags = std::stoul(rit->second);
|
||||
if((rit = uQ.find("publishDate")) != uQ.end())
|
||||
{
|
||||
std::tm tm; memset(&tm, 0, sizeof(tm));
|
||||
#if defined(GCC_VERSION) && GCC_VERSION > 50100
|
||||
std::istringstream ss(rit->second);
|
||||
std::tm tm;
|
||||
ss >> std::get_time(&tm, "%Y%m%d");
|
||||
#else // defined(GCC_VERSION) && GCC_VERSION > 50100
|
||||
sscanf( rit->second.c_str(),
|
||||
"%4d%2d%2d", &tm.tm_year, &tm.tm_mon, &tm.tm_mday );
|
||||
#endif // defined(GCC_VERSION) && GCC_VERSION > 50100
|
||||
|
||||
s.mPublishTs = mktime(&tm);
|
||||
}
|
||||
if((rit = uQ.find("authorId")) != uQ.end())
|
||||
|
Loading…
Reference in New Issue
Block a user