diff options
author | David Zeuthen <david@fubar.dk> | 2005-07-21 19:03:34 +0000 |
---|---|---|
committer | David Zeuthen <david@fubar.dk> | 2005-07-21 19:03:34 +0000 |
commit | ae6cedfe56f56a4b805eb563e98f7420eb10487f (patch) | |
tree | 64f03089518f00287fb5166b7ad5166d5e4a9d61 /libhal/libhal.h | |
parent | 81e09a3ba1c7bcf374dd6fc4639c638de180122e (diff) |
Patch from Danny Kukawka <danny.kukawka@web.de>: here the new patch with a
macro instead of always the same codeblock in so many funtions.
Diffstat (limited to 'libhal/libhal.h')
-rw-r--r-- | libhal/libhal.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/libhal/libhal.h b/libhal/libhal.h index 11e41bc2..c79f8ec2 100644 --- a/libhal/libhal.h +++ b/libhal/libhal.h @@ -35,6 +35,17 @@ extern "C" { #endif #endif +/** Checks if LibHalContext *ctx == NULL */ +#define LIBHAL_CHECK_LIBHALCONTEXT(_ctx_, _ret_) \ + do { \ + if (_ctx_ == NULL) { \ + fprintf (stderr, \ + "%s %d : LibHalContext *ctx is NULL\n", \ + __FILE__, __LINE__); \ + return _ret_; \ + } \ + } while(0) + /** * @addtogroup LibHal * |