mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-03-06 13:46:11 -05:00
Fix compiling with old GCC
This commit is contained in:
parent
d9aa37219c
commit
51c25219bb
@ -243,7 +243,6 @@
|
|||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <typeinfo>
|
#include <typeinfo>
|
||||||
#include <iomanip>
|
|
||||||
|
|
||||||
#include "rsgxsnetservice.h"
|
#include "rsgxsnetservice.h"
|
||||||
#include "gxssecurity.h"
|
#include "gxssecurity.h"
|
||||||
@ -262,6 +261,13 @@
|
|||||||
# include "deep_search/deep_search.h"
|
# include "deep_search/deep_search.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include "util/cxx11retrocompat.h"
|
||||||
|
#if defined(GCC_VERSION) && GCC_VERSION > 50100
|
||||||
|
# include <iomanip>
|
||||||
|
#else
|
||||||
|
# include <cstdio>
|
||||||
|
#endif
|
||||||
|
|
||||||
/***
|
/***
|
||||||
* Use the following defines to debug:
|
* Use the following defines to debug:
|
||||||
NXS_NET_DEBUG_0 shows group update high level information
|
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);
|
s.mSignFlags = std::stoul(rit->second);
|
||||||
if((rit = uQ.find("publishDate")) != uQ.end())
|
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::istringstream ss(rit->second);
|
||||||
std::tm tm;
|
|
||||||
ss >> std::get_time(&tm, "%Y%m%d");
|
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);
|
s.mPublishTs = mktime(&tm);
|
||||||
}
|
}
|
||||||
if((rit = uQ.find("authorId")) != uQ.end())
|
if((rit = uQ.find("authorId")) != uQ.end())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user