*
* @section XBT_ex_base BASIC USAGE
*
- * \em TRY \b TRIED_BLOCK [\em CLEANUP \b CLEANUP_BLOCK] \em CATCH (variable) \b CATCH_BLOCK
+ * \em TRY \b TRIED_BLOCK [\em _CLEANUP \b _CLEANUP_BLOCK] \em CATCH (variable) \b CATCH_BLOCK
*
* This is the primary syntactical construct provided. It is modeled after the
* ISO-C++ try-catch clause and should sound familiar to most of you.
*
*
* In absence of exception, the control flow goes into the blocks TRIED_BLOCK
- * and CLEANUP_BLOCK (if present); The CATCH_BLOCK block is then ignored.
+ * and CLEANUP_BLOCK (if present); The CATCH_BLOCK block is then ignored.
*
* When an exception is thrown, the control flow goes through the following
* blocks: TRIED_BLOCK (up to the statement throwing the exception),
if (__ex_mctx_save(&__ex_mctx_me)) { \
if (1)
-/** @brief optional(!) block for cleanup
+/** @brief optional(!) block for cleanup
* @hideinitializer
*/
-#define CLEANUP \
+#define _CLEANUP \
else { \
} \
__xbt_ex_ctx_ptr->ctx_caught = 0; \
*
* If called from within a TRY/CATCH construct, this exception
* is copied into the CATCH relevant variable program control flow
- * is derouted to the CATCH (after the optional sg_cleanup).
+ * is derouted to the CATCH (after the optional sg_cleanup).
*
* If no TRY/CATCH construct embeeds this call, the program calls
* abort(3).
TRY {
v1 = 5678;
THROW0(1, 2, "blah");
- } CLEANUP {
+ } _CLEANUP {
if (v1 != 5678)
xbt_test_fail1("v1 = %d (!= 5678)", v1);
c = 1;
cp3 = mallocex(SMALLAMOUNT);
strcpy(cp1, "foo");
strcpy(cp2, "bar");
- } CLEANUP {
+ } _CLEANUP {
if (cp3 != NULL)
free(cp3);
if (cp2 != NULL)
cp3 = mallocex(SMALLAMOUNT);
strcpy(cp1, "foo");
strcpy(cp2, "bar");
- } CLEANUP { /*04 */
+ } _CLEANUP { /*04 */
printf("cp3=%s", cp3 == NULL /*02 */ ? "" : cp3);
if (cp3 != NULL)
free(cp3);
}
TRY {
- size =
- gras_datadesc_memcpy_rec(state, refs, type, (char *) src, (char *) dst,
- 0, type->cycle);
- } CLEANUP {
+ size = gras_datadesc_memcpy_rec(state, refs, type, (char *) src, (char *) dst,0, type->cycle);
+ } _CLEANUP {
xbt_dict_reset(refs);
gras_cbps_reset(state);
} CATCH(e) {
TRY {
gras_datadesc_send_rec(sock, state, refs, type, (char *) src,
type->cycle);
- } CLEANUP {
+ } _CLEANUP {
xbt_dict_reset(refs);
gras_cbps_reset(state);
} CATCH(e) {
TRY {
gras_datadesc_recv_rec(sock, state, refs, type,
r_arch, NULL, 0, (char *) dst, -1, type->cycle);
- } CLEANUP {
+ } _CLEANUP {
xbt_dict_reset(refs);
gras_cbps_reset(state);
} CATCH(e) {
TRY {
xbt_multidict_set_ext(mdict, keys, lens, data, free_ctn);
- } CLEANUP {
+ } _CLEANUP {
xbt_dynar_free(&lens);
} CATCH(e) {
RETHROW;
TRY {
xbt_multidict_remove_ext(mdict, keys, lens);
- } CLEANUP {
+ } _CLEANUP {
xbt_dynar_free(&lens);
} CATCH(e) {
RETHROW;
TRY {
v1 = 5678;
THROW0(1, 2, "blah");
- } CLEANUP {
+ } _CLEANUP {
if (v1 != 5678)
xbt_test_fail1("v1 = %d (!= 5678)", v1);
c = 1;
cp3 = mallocex(SMALLAMOUNT);
strcpy(cp1, "foo");
strcpy(cp2, "bar");
- } CLEANUP {
+ } _CLEANUP {
if (cp3 != NULL)
free(cp3);
if (cp2 != NULL)
cp3 = mallocex(SMALLAMOUNT);
strcpy(cp1, "foo");
strcpy(cp2, "bar");
- } CLEANUP { /*04 */
+ } _CLEANUP { /*04 */
printf("cp3=%s", cp3 == NULL /*02 */ ? "" : cp3);
if (cp3 != NULL)
free(cp3);