diff --git a/src/opt/ufar/UfarPth.cpp b/src/opt/ufar/UfarPth.cpp index 085614275..6df45657f 100755 --- a/src/opt/ufar/UfarPth.cpp +++ b/src/opt/ufar/UfarPth.cpp @@ -11,15 +11,15 @@ #include "opt/untk/NtkNtk.h" #include "UfarPth.h" -ABC_NAMESPACE_IMPL_START - -extern "C" { +ABC_NAMESPACE_HEADER_START Abc_Ntk_t * Abc_NtkFromAigPhase( Aig_Man_t * pAig ); int Abc_NtkDarBmc3( Abc_Ntk_t * pAbcNtk, Saig_ParBmc_t * pBmcPars, int fOrDecomp ); Wla_Man_t * Wla_ManStart( Wlc_Ntk_t * pNtk, Wlc_Par_t * pPars ); void Wla_ManStop( Wla_Man_t * pWla ); int Wla_ManSolve( Wla_Man_t * pWla, Wlc_Par_t * pPars ); -} +ABC_NAMESPACE_HEADER_END + +ABC_NAMESPACE_IMPL_START static volatile int g_nRunIds = 0; // the number of the last prover instance int Ufar_CallBackToStop( int RunId ) { assert( RunId <= g_nRunIds ); return RunId < g_nRunIds; } diff --git a/src/opt/untk/NtkNtk.cpp b/src/opt/untk/NtkNtk.cpp index ada25c2b2..0ee5e5fd7 100755 --- a/src/opt/untk/NtkNtk.cpp +++ b/src/opt/untk/NtkNtk.cpp @@ -20,9 +20,7 @@ #include "NtkNtk.h" #include "Netlist.h" -ABC_NAMESPACE_IMPL_START - -extern "C" { +ABC_NAMESPACE_HEADER_START Abc_Ntk_t * Abc_NtkFromAigPhase( Aig_Man_t * pMan ); int Abc_NtkDarPdr( Abc_Ntk_t * pNtk, Pdr_Par_t * pPars ); int Abc_NtkDarBmc3( Abc_Ntk_t * pNtk, Saig_ParBmc_t * pPars, int fOrDecomp ); @@ -36,7 +34,9 @@ extern "C" { int Wla_ManSolve( Wla_Man_t * pWla, Wlc_Par_t * pPars ); Gia_Man_t * Wlc_NtkBitBlast2( Wlc_Ntk_t * p, Vec_Int_t * vBoxIds ); //void Gia_ManPrintStats( Gia_Man_t * p, Gps_Par_t * pPars ); -} +ABC_NAMESPACE_HEADER_END + +ABC_NAMESPACE_IMPL_START using namespace std; diff --git a/src/opt/util/util.cpp b/src/opt/util/util.cpp old mode 100755 new mode 100644 index f20588466..47101c36b --- a/src/opt/util/util.cpp +++ b/src/opt/util/util.cpp @@ -12,6 +12,17 @@ #include "misc/util/abc_namespaces.h" #include "util.h" +#ifdef __linux__ +#include +#elif defined(__APPLE__) +#include +#include +#include +#include +#include +#include +#endif + ABC_NAMESPACE_IMPL_START using namespace std; @@ -50,14 +61,8 @@ void OptMgr::PrintUsage() { } } -ABC_NAMESPACE_IMPL_END - #ifdef __linux__ -#include - -ABC_NAMESPACE_IMPL_START - void kill_on_parent_death(int sig) { // kill process if parent dies @@ -71,21 +76,8 @@ void kill_on_parent_death(int sig) } } -ABC_NAMESPACE_IMPL_END - #elif defined(__APPLE__) -#include - -#include -#include - -#include -#include -#include - -ABC_NAMESPACE_IMPL_START - template static auto retry_eintr(Func &&fn) -> decltype(fn()) { @@ -115,7 +107,7 @@ void kill_on_parent_death(int sig) kevent(kq, &change, 1, &event, 1, &ts); // however, if ppid died before the call to kevent, ppid might not be the pid of the parent - // in that case, the process it would be adopted by init, whose pid is 1 + // in that case, it would be adopted by init, whose pid is 1 if( getppid() == 1 ) { raise(sig); @@ -132,16 +124,12 @@ void kill_on_parent_death(int sig) monitor_thread.detach(); } -ABC_NAMESPACE_IMPL_END - #else // neither linux or OS X -ABC_NAMESPACE_IMPL_START - void kill_on_parent_death(int sig) { } -ABC_NAMESPACE_IMPL_END - #endif + +ABC_NAMESPACE_IMPL_END