Teuchos Package Browser (Single Doxygen Collection)
Version of the Day
Loading...
Searching...
No Matches
core
test
CWrapperSupport
someCFunc.cpp
Go to the documentation of this file.
1
#include "
Teuchos_CWrapperSupport_Cpp.hpp
"
2
#include "
Teuchos_Assert.hpp
"
3
4
5
extern
"C"
{
6
7
8
int
someCFunc
(
int
input,
int
*ierr)
9
{
10
int
output = -1;
11
TEUCHOS_CWRAPPER_TRY
(ierr) {
12
TEUCHOS_ASSERT_INEQUALITY
(input, >=, 0);
13
if
(input > 10) {
14
TEUCHOS_CWRAPPER_SET_ERROR_CODE
(ierr, -2);
15
}
16
else
{
17
output = input;
18
}
19
}
TEUCHOS_CWRAPPER_CATCH_ERROR_CODE
(ierr);
20
return
output;
21
}
22
23
24
}
// extern "C"
Teuchos_Assert.hpp
Teuchos_CWrapperSupport_Cpp.hpp
TEUCHOS_ASSERT_INEQUALITY
#define TEUCHOS_ASSERT_INEQUALITY(val1, comp, val2)
This macro is checks that an inequality between two numbers is satisified and if not then throws a go...
Definition
Teuchos_Assert.hpp:126
TEUCHOS_CWRAPPER_CATCH_ERROR_CODE
#define TEUCHOS_CWRAPPER_CATCH_ERROR_CODE(IERR)
Define the catch blocks and set the error code.
Definition
Teuchos_CWrapperSupport_Cpp.hpp:111
TEUCHOS_CWRAPPER_SET_ERROR_CODE
#define TEUCHOS_CWRAPPER_SET_ERROR_CODE(IERR, IERR_VALUE)
Set the error code.
Definition
Teuchos_CWrapperSupport_Cpp.hpp:128
TEUCHOS_CWRAPPER_TRY
#define TEUCHOS_CWRAPPER_TRY(IERR)
Define a try block.
Definition
Teuchos_CWrapperSupport_Cpp.hpp:98
someCFunc
int someCFunc(int input, int *ierr)
Definition
someCFunc.cpp:8
Generated by
1.10.0