From: smccam Date: Thu, 1 Apr 2010 20:01:52 +0000 (+0000) Subject: Specify default arguments only when compiling C++. X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=cf471108652e11af1ad34adcfd83ba2142fd2a1a;p=francis%2Fstp.git Specify default arguments only when compiling C++. Patch from Peter Collingbourne. git-svn-id: https://stp-fast-prover.svn.sourceforge.net/svnroot/stp-fast-prover/trunk/stp@661 e59a4935-1847-0410-ae03-e826735625c1 --- diff --git a/src/c_interface/c_interface.h b/src/c_interface/c_interface.h index 06486e4..8e280e5 100644 --- a/src/c_interface/c_interface.h +++ b/src/c_interface/c_interface.h @@ -19,6 +19,12 @@ #ifndef _cvcl__include__c_interface_h_ #define _cvcl__include__c_interface_h_ +#ifdef __cplusplus +#define _CVCL_DEFAULT_ARG(v) =v +#else +#define _CVCL_DEFAULT_ARG(v) +#endif + #ifdef __cplusplus extern "C" { #endif @@ -42,7 +48,7 @@ extern "C" { // h : help // s : stats // v : print nodes - void vc_setFlags(VC vc, char c, int num_absrefine=0); + void vc_setFlags(VC vc, char c, int num_absrefine _CVCL_DEFAULT_ARG(0)); //! Flags can be NULL VC vc_createValidityChecker(void); @@ -154,7 +160,7 @@ extern "C" { //! Prints asserts to stdout. The flag simplify_print must be set to //"1" if you wish simplification to occur dring printing. It must be //set to "0" otherwise - void vc_printAsserts(VC vc, int simplify_print=0); + void vc_printAsserts(VC vc, int simplify_print _CVCL_DEFAULT_ARG(0)); //! Prints the state of the query to malloc'd buffer '*buf' and //stores ! the length of the buffer to '*len'. It is the @@ -176,7 +182,7 @@ extern "C" { //! Assert a new formula in the current context. /*! The formula must have Boolean type. */ - void vc_assertFormula(VC vc, Expr e, int absrefine_bucket_num=0); + void vc_assertFormula(VC vc, Expr e, int absrefine_bucket_num _CVCL_DEFAULT_ARG(0)); //! Simplify e with respect to the current context Expr vc_simplify(VC vc, Expr e); @@ -427,6 +433,8 @@ extern "C" { } #endif +#undef _CVCL_DEFAULT_ARG + #endif