From dc4320d7d7fa00975132f659b4a41052b3d0030f Mon Sep 17 00:00:00 2001 From: Baruch Sterin Date: Mon, 2 Apr 2018 14:40:29 -0700 Subject: Travis: build with namespaces enabled, and make sure src/demo.c can be compiled under C++ and with ABC in a namespace --- src/demo.c | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/demo.c b/src/demo.c index eebb8aba..e6616d4b 100644 --- a/src/demo.c +++ b/src/demo.c @@ -25,14 +25,31 @@ /// DECLARATIONS /// //////////////////////////////////////////////////////////////////////// +#if defined(ABC_NAMESPACE) +namespace ABC_NAMESPACE +{ +#elif defined(__cplusplus) +extern "C" +{ +#endif + // procedures to start and stop the ABC framework // (should be called before and after the ABC procedures are called) -extern void Abc_Start(); -extern void Abc_Stop(); +void Abc_Start(); +void Abc_Stop(); // procedures to get the ABC framework and execute commands in it -extern void * Abc_FrameGetGlobalFrame(); -extern int Cmd_CommandExecute( void * pAbc, char * sCommand ); +typedef struct Abc_Frame_t_ Abc_Frame_t; + +Abc_Frame_t * Abc_FrameGetGlobalFrame(); +int Cmd_CommandExecute( Abc_Frame_t * pAbc, const char * sCommand ); + +#if defined(ABC_NAMESPACE) +} +using namespace ABC_NAMESPACE; +#elif defined(__cplusplus) +} +#endif //////////////////////////////////////////////////////////////////////// /// FUNCTION DEFINITIONS /// @@ -60,7 +77,7 @@ int main( int argc, char * argv[] ) int fPrintStats = 1; int fVerify = 1; // variables - void * pAbc; + Abc_Frame_t * pAbc; char * pFileName; char Command[1000]; clock_t clkRead, clkResyn, clkVer, clk; -- cgit v1.2.3