mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Remove the #include <execinfo.h> on darwin OS
This commit is contained in:
@ -32,7 +32,9 @@ License
|
|||||||
#include "readHexLabel.H"
|
#include "readHexLabel.H"
|
||||||
|
|
||||||
#include <cxxabi.h>
|
#include <cxxabi.h>
|
||||||
|
#ifndef darwin
|
||||||
#include <execinfo.h>
|
#include <execinfo.h>
|
||||||
|
#endif
|
||||||
#include <dlfcn.h>
|
#include <dlfcn.h>
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
@ -65,7 +67,7 @@ string pOpen(const string &cmd, label line=0)
|
|||||||
{
|
{
|
||||||
string str(buffer);
|
string str(buffer);
|
||||||
return str.substr(0, str.size()-1);
|
return str.substr(0, str.size()-1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
pclose(cmdPipe);
|
pclose(cmdPipe);
|
||||||
}
|
}
|
||||||
@ -93,9 +95,9 @@ void printSourceFileAndLine
|
|||||||
|
|
||||||
void *addr;
|
void *addr;
|
||||||
sscanf(myAddress.c_str(), "%p",&addr);
|
sscanf(myAddress.c_str(), "%p",&addr);
|
||||||
|
|
||||||
Dl_info info;
|
Dl_info info;
|
||||||
|
|
||||||
dladdr(addr, &info);
|
dladdr(addr, &info);
|
||||||
|
|
||||||
unsigned long offset = ulong(info.dli_fbase);
|
unsigned long offset = ulong(info.dli_fbase);
|
||||||
@ -216,7 +218,7 @@ void error::printStack(Ostream& os)
|
|||||||
{
|
{
|
||||||
string::size_type lPos = msg.find('[');
|
string::size_type lPos = msg.find('[');
|
||||||
string::size_type rPos = msg.find(']');
|
string::size_type rPos = msg.find(']');
|
||||||
|
|
||||||
if (lPos != string::npos && rPos != string::npos && lPos<rPos)
|
if (lPos != string::npos && rPos != string::npos && lPos<rPos)
|
||||||
{
|
{
|
||||||
address = msg.substr(lPos+1, rPos-lPos-1);
|
address = msg.substr(lPos+1, rPos-lPos-1);
|
||||||
@ -274,7 +276,7 @@ void error::printStack(Ostream& os)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
string::size_type endBracketPos = msg.find(')', start);
|
string::size_type endBracketPos = msg.find(')', start);
|
||||||
|
|
||||||
if (endBracketPos != string::size_type(string::npos))
|
if (endBracketPos != string::size_type(string::npos))
|
||||||
{
|
{
|
||||||
string fullName(msg.substr(start, endBracketPos-start));
|
string fullName(msg.substr(start, endBracketPos-start));
|
||||||
|
|||||||
Reference in New Issue
Block a user