From a38d012563fa071ca1f91dd490b9995d5a6dd81a Mon Sep 17 00:00:00 2001 From: Alan Mishchenko Date: Wed, 24 Dec 2025 19:47:46 -0800 Subject: [PATCH] Added proper guards to new files. --- src/opt/ufar/UfarCmd.cpp | 4 +++- src/opt/ufar/UfarCmd.h | 8 ++------ src/opt/ufar/UfarMgr.cpp | 4 ++++ src/opt/ufar/UfarMgr.h | 6 ++++++ src/opt/ufar/UfarPth.cpp | 6 ++++++ src/opt/ufar/UfarPth.h | 4 ++++ src/opt/untk/Netlist.cpp | 4 ++++ src/opt/untk/Netlist.h | 6 ++++++ src/opt/untk/NtkCmd.cpp | 4 ++++ src/opt/untk/NtkCmd.h | 4 ++++ src/opt/untk/NtkNtk.cpp | 4 ++++ src/opt/untk/NtkNtk.h | 4 ++++ src/opt/util/util.cpp | 5 +++++ src/opt/util/util.h | 4 ++++ 14 files changed, 60 insertions(+), 7 deletions(-) diff --git a/src/opt/ufar/UfarCmd.cpp b/src/opt/ufar/UfarCmd.cpp index 33b0cc3f7..a42a6a536 100755 --- a/src/opt/ufar/UfarCmd.cpp +++ b/src/opt/ufar/UfarCmd.cpp @@ -16,6 +16,8 @@ #include #include +ABC_NAMESPACE_IMPL_START + using namespace std; static UFAR::UfarManager ufar_manager; @@ -333,4 +335,4 @@ static int Abc_CommandTest( Abc_Frame_t * pAbc, int argc, char ** argv ) #endif } - +ABC_NAMESPACE_IMPL_END diff --git a/src/opt/ufar/UfarCmd.h b/src/opt/ufar/UfarCmd.h index 40bdd5cf6..d2b775269 100755 --- a/src/opt/ufar/UfarCmd.h +++ b/src/opt/ufar/UfarCmd.h @@ -10,14 +10,10 @@ #include "base/main/mainInt.h" -#ifdef __cplusplus -extern "C" { -#endif +ABC_NAMESPACE_HEADER_START void Ufar_Init(Abc_Frame_t *pAbc); -#ifdef __cplusplus -} -#endif +ABC_NAMESPACE_HEADER_END #endif /* SRC_EXT2_UIF_UIFCMD_H_ */ diff --git a/src/opt/ufar/UfarMgr.cpp b/src/opt/ufar/UfarMgr.cpp index 071cfcf9e..6f956fdaf 100755 --- a/src/opt/ufar/UfarMgr.cpp +++ b/src/opt/ufar/UfarMgr.cpp @@ -16,6 +16,8 @@ #include #include +ABC_NAMESPACE_IMPL_START + extern "C" { Abc_Ntk_t * Abc_NtkFromAigPhase( Aig_Man_t * pMan ); void Wlc_NtkSimulatePrint( Wlc_Ntk_t * p, Vec_Int_t * vNodes, Vec_Ptr_t * vRes, int nWords, int nFrames ); @@ -1661,3 +1663,5 @@ void UfarManager::_read_states(const std::string &file) { } } + +ABC_NAMESPACE_IMPL_END diff --git a/src/opt/ufar/UfarMgr.h b/src/opt/ufar/UfarMgr.h index 823e47a18..74f024752 100755 --- a/src/opt/ufar/UfarMgr.h +++ b/src/opt/ufar/UfarMgr.h @@ -17,10 +17,14 @@ #include #include +#include "misc/util/abc_namespaces.h" + typedef struct Wlc_Ntk_t_ Wlc_Ntk_t; typedef struct Abc_Cex_t_ Abc_Cex_t; typedef struct Gia_Man_t_ Gia_Man_t; +ABC_NAMESPACE_CXX_HEADER_START + namespace UFAR { using VecVecInt = std::vector >; @@ -141,4 +145,6 @@ class UfarManager { } +ABC_NAMESPACE_CXX_HEADER_END + #endif /* SRC_EXT2_UIF_UIFMGR_H_ */ diff --git a/src/opt/ufar/UfarPth.cpp b/src/opt/ufar/UfarPth.cpp index 45adea846..2a01bcc56 100755 --- a/src/opt/ufar/UfarPth.cpp +++ b/src/opt/ufar/UfarPth.cpp @@ -5,9 +5,13 @@ #include "proof/pdr/pdr.h" #include "aig/gia/giaAig.h" +#include "misc/util/abc_namespaces.h" + #include #include +ABC_NAMESPACE_IMPL_START + extern "C" { Abc_Ntk_t * Abc_NtkFromAigPhase( Aig_Man_t * pAig ); int Abc_NtkDarBmc3( Abc_Ntk_t * pAbcNtk, Saig_ParBmc_t * pBmcPars, int fOrDecomp ); @@ -287,3 +291,5 @@ int RunConcurrentSolver( Wlc_Ntk_t * pNtk, const vector& vSolvers, Abc_C } + +ABC_NAMESPACE_IMPL_END diff --git a/src/opt/ufar/UfarPth.h b/src/opt/ufar/UfarPth.h index d05da25fc..029a24d3a 100755 --- a/src/opt/ufar/UfarPth.h +++ b/src/opt/ufar/UfarPth.h @@ -9,9 +9,13 @@ #include #include +ABC_NAMESPACE_CXX_HEADER_START + namespace UFAR { int RunConcurrentSolver( Wlc_Ntk_t * pNtk, const std::vector& vSolvers, Abc_Cex_t ** ppCex, struct timespec * timeout ); } +ABC_NAMESPACE_CXX_HEADER_END + #endif //SRC_EXT2_UFAR_PTH_H diff --git a/src/opt/untk/Netlist.cpp b/src/opt/untk/Netlist.cpp index c6643e443..e06be9661 100755 --- a/src/opt/untk/Netlist.cpp +++ b/src/opt/untk/Netlist.cpp @@ -8,6 +8,8 @@ #include +ABC_NAMESPACE_IMPL_START + using namespace std; namespace UFAR { @@ -61,3 +63,5 @@ void WNetlist::Reset(Wlc_Ntk_t *pNtk) { } } + +ABC_NAMESPACE_IMPL_END diff --git a/src/opt/untk/Netlist.h b/src/opt/untk/Netlist.h index 07b6032c5..e47d03ff8 100755 --- a/src/opt/untk/Netlist.h +++ b/src/opt/untk/Netlist.h @@ -7,8 +7,12 @@ #include +#include "misc/util/abc_namespaces.h" + typedef struct Wlc_Ntk_t_ Wlc_Ntk_t; +ABC_NAMESPACE_CXX_HEADER_START + namespace UFAR { class WNetlist { @@ -30,4 +34,6 @@ private: } +ABC_NAMESPACE_CXX_HEADER_END + #endif //ABC_WAR_NETLIST_H diff --git a/src/opt/untk/NtkCmd.cpp b/src/opt/untk/NtkCmd.cpp index 19f73f87f..a31534ed2 100755 --- a/src/opt/untk/NtkCmd.cpp +++ b/src/opt/untk/NtkCmd.cpp @@ -7,6 +7,10 @@ #include "opt/untk/NtkCmd.h" +ABC_NAMESPACE_IMPL_START + void Ntk_Init (Abc_Frame_t *pAbc) { } + +ABC_NAMESPACE_IMPL_END diff --git a/src/opt/untk/NtkCmd.h b/src/opt/untk/NtkCmd.h index 77790a083..916d2875c 100755 --- a/src/opt/untk/NtkCmd.h +++ b/src/opt/untk/NtkCmd.h @@ -10,6 +10,10 @@ #include "base/main/mainInt.h" +ABC_NAMESPACE_CXX_HEADER_START + void Ntk_Init(Abc_Frame_t *pAbc); +ABC_NAMESPACE_CXX_HEADER_END + #endif /* SRC_EXT2_NTK_NTKCMD_H_ */ diff --git a/src/opt/untk/NtkNtk.cpp b/src/opt/untk/NtkNtk.cpp index 2c94bcd16..bd81a362b 100755 --- a/src/opt/untk/NtkNtk.cpp +++ b/src/opt/untk/NtkNtk.cpp @@ -20,6 +20,8 @@ #include #include +ABC_NAMESPACE_IMPL_START + extern "C" { Abc_Ntk_t * Abc_NtkFromAigPhase( Aig_Man_t * pMan ); int Abc_NtkDarPdr( Abc_Ntk_t * pNtk, Pdr_Par_t * pPars ); @@ -1485,3 +1487,5 @@ void TestInvariant(string& nameNtk, string& nameInv) { } + +ABC_NAMESPACE_IMPL_END diff --git a/src/opt/untk/NtkNtk.h b/src/opt/untk/NtkNtk.h index 816a9c61f..14103bed9 100755 --- a/src/opt/untk/NtkNtk.h +++ b/src/opt/untk/NtkNtk.h @@ -17,6 +17,8 @@ #include #include "Netlist.h" +ABC_NAMESPACE_CXX_HEADER_START + typedef struct Wlc_Ntk_t_ Wlc_Ntk_t; typedef struct Abc_Cex_t_ Abc_Cex_t; typedef struct Vec_Int_t_ Vec_Int_t; @@ -147,4 +149,6 @@ Wlc_Ntk_t * MakeUnderApprox2(Wlc_Ntk_t * pNtk, const std::set& types, } +ABC_NAMESPACE_CXX_HEADER_END + #endif /* SRC_EXT2_NTK_NTKNTK_H_ */ diff --git a/src/opt/util/util.cpp b/src/opt/util/util.cpp index 3b5f1802c..9fc5ea1a0 100755 --- a/src/opt/util/util.cpp +++ b/src/opt/util/util.cpp @@ -9,8 +9,11 @@ #include #include +#include "misc/util/abc_namespaces.h" #include "util.h" +ABC_NAMESPACE_IMPL_START + using namespace std; unsigned LogT::loglevel = 0; @@ -117,3 +120,5 @@ void kill_on_parent_death(int sig) } #endif + +ABC_NAMESPACE_IMPL_END diff --git a/src/opt/util/util.h b/src/opt/util/util.h index 747177266..b2b3a508c 100755 --- a/src/opt/util/util.h +++ b/src/opt/util/util.h @@ -18,6 +18,8 @@ #include +ABC_NAMESPACE_CXX_HEADER_START + class LogT { public: LogT(unsigned _loglevel = 0) { @@ -82,4 +84,6 @@ void kill_on_parent_death(int sig); int call_python(const char* modulename, const char* funcname, const char* aig, std::vector& cex); +ABC_NAMESPACE_CXX_HEADER_END + #endif /* SRC_EXT2_UTIL_UTIL_H_ */