mirror of
https://github.com/yse/easy_profiler.git
synced 2024-12-28 17:28:14 +08:00
Linux build
This commit is contained in:
parent
db5a866c0d
commit
15ba83cb20
@ -232,13 +232,23 @@ extern "C" {
|
|||||||
::profiler::thread_blocks_tree_t& threaded_trees,
|
::profiler::thread_blocks_tree_t& threaded_trees,
|
||||||
bool gather_statistics)
|
bool gather_statistics)
|
||||||
{
|
{
|
||||||
::std::ifstream inFile(filename, ::std::fstream::binary);
|
|
||||||
progress.store(0);
|
progress.store(0);
|
||||||
|
|
||||||
|
::std::ifstream inFile(filename, ::std::fstream::binary);
|
||||||
if (!inFile.is_open())
|
if (!inFile.is_open())
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
::std::stringstream str;
|
::std::stringstream str;
|
||||||
|
|
||||||
|
#ifdef _WIN32
|
||||||
str.set_rdbuf(inFile.rdbuf());
|
str.set_rdbuf(inFile.rdbuf());
|
||||||
return fillTreesFromStream(progress, str, serialized_blocks, serialized_descriptors, descriptors, blocks, threaded_trees, gather_statistics);
|
return fillTreesFromStream(progress, str, serialized_blocks, serialized_descriptors, descriptors, blocks, threaded_trees, gather_statistics);
|
||||||
|
#else
|
||||||
|
auto oldbuf = str.rdbuf(inFile.rdbuf());
|
||||||
|
auto result = fillTreesFromStream(progress, str, serialized_blocks, serialized_descriptors, descriptors, blocks, threaded_trees, gather_statistics);
|
||||||
|
str.rdbuf(oldbuf);
|
||||||
|
return result;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
|
Loading…
x
Reference in New Issue
Block a user