Commit 2ab82d9f authored by Pascal Palenda's avatar Pascal Palenda
Browse files

Fix some problems with methods only available with MSVC

parent 24f24e3a
......@@ -313,12 +313,12 @@ namespace ITAProfiler
jnRoot.set_name ( "[" + eventCountPair.first.sFunction + "][" + eventCountPair.first.sName + "][" + sThreadName + "]" );
else
jnRoot.set_name ( "[" + eventCountPair.first.sFunction + "][" + eventCountPair.first.sName + "][" +
std::to_string ( eventCountPair.first.iThreadId.hash ( ) ) + "]" );
std::to_string ( std::hash<std::thread::id>()(eventCountPair.first.iThreadId) ) + "]" );
jnRoot.push_back ( JSONNode ( "Name", eventCountPair.first.sName ) );
jnRoot.push_back ( JSONNode ( "File Name", eventCountPair.first.sFile ) );
jnRoot.push_back ( JSONNode ( "Function Name", eventCountPair.first.sFunction ) );
jnRoot.push_back ( JSONNode ( "Thread Id", eventCountPair.first.iThreadId.hash ( ) ) );
jnRoot.push_back ( JSONNode ( "Thread Id", std::hash<std::thread::id>()(eventCountPair.first.iThreadId) ) );
if ( !sThreadName.empty ( ) )
jnRoot.push_back ( JSONNode ( "Thread Name", sThreadName ) );
......@@ -373,13 +373,13 @@ namespace ITAProfiler
if ( !sThreadName.empty ( ) )
jnRoot.set_name ( "[" + sectionPair.first.sFunction + "][" + sectionPair.first.sName + "][" + sThreadName + "]" );
else
jnRoot.set_name ( "[" + sectionPair.first.sFunction + "][" + sectionPair.first.sName + "][" + std::to_string ( sectionPair.first.iThreadId.hash ( ) ) +
jnRoot.set_name ( "[" + sectionPair.first.sFunction + "][" + sectionPair.first.sName + "][" + std::to_string ( std::hash<std::thread::id>()(sectionPair.first.iThreadId) ) +
"]" );
jnRoot.push_back ( JSONNode ( "Name", sectionPair.first.sName ) );
jnRoot.push_back ( JSONNode ( "File Name", sectionPair.first.sFile ) );
jnRoot.push_back ( JSONNode ( "Function Name", sectionPair.first.sFunction ) );
jnRoot.push_back ( JSONNode ( "Thread Id", sectionPair.first.iThreadId.hash ( ) ) );
jnRoot.push_back ( JSONNode ( "Thread Id", std::hash<std::thread::id>()(sectionPair.first.iThreadId ) ) );
if ( !sThreadName.empty ( ) )
jnRoot.push_back ( JSONNode ( "Thread Name", sThreadName ) );
......@@ -451,12 +451,13 @@ namespace ITAProfiler
if ( !sThreadName.empty ( ) )
jnRoot.set_name ( "[" + valuePair.first.sFunction + "][" + valuePair.first.sName + "][" + sThreadName + "]" );
else
jnRoot.set_name ( "[" + valuePair.first.sFunction + "][" + valuePair.first.sName + "][" + std::to_string ( valuePair.first.iThreadId.hash ( ) ) + "]" );
jnRoot.set_name ( "[" + valuePair.first.sFunction + "][" + valuePair.first.sName + "][" +
std::to_string ( std::hash<std::thread::id> ( ) ( valuePair.first.iThreadId ) ) + "]" );
jnRoot.push_back ( JSONNode ( "Name", valuePair.first.sName ) );
jnRoot.push_back ( JSONNode ( "File Name", valuePair.first.sFile ) );
jnRoot.push_back ( JSONNode ( "Function Name", valuePair.first.sFunction ) );
jnRoot.push_back ( JSONNode ( "Thread Id", valuePair.first.iThreadId.hash ( ) ) );
jnRoot.push_back ( JSONNode ( "Thread Id", std::hash<std::thread::id>()(valuePair.first.iThreadId ) ) );
if ( !sThreadName.empty ( ) )
jnRoot.push_back ( JSONNode ( "Thread Name", sThreadName ) );
......
......@@ -4,6 +4,7 @@
// std includes
#include <cassert>
#include <vector>
#include <algorithm>
// simulation scheduler includes
#include "ITAProfiler/profiler.h"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment