aboutsummaryrefslogtreecommitdiffstats
path: root/include/slibc-error.h
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2015-11-25 11:46:10 +0100
committerMattias Andrée <maandree@operamail.com>2015-11-25 11:46:10 +0100
commit9537d8e087731fc6d6de22d29b2dccda572d7f06 (patch)
tree138e08037c8dad2b455a04bd5f972c03ddc2cff2 /include/slibc-error.h
parentslibc-print does not define NULL (diff)
downloadslibc-9537d8e087731fc6d6de22d29b2dccda572d7f06.tar.gz
slibc-9537d8e087731fc6d6de22d29b2dccda572d7f06.tar.bz2
slibc-9537d8e087731fc6d6de22d29b2dccda572d7f06.tar.xz
tell in doc in which version things were introduced
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to 'include/slibc-error.h')
-rw-r--r--include/slibc-error.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/slibc-error.h b/include/slibc-error.h
index 66d1e50..7e1bca2 100644
--- a/include/slibc-error.h
+++ b/include/slibc-error.h
@@ -77,6 +77,8 @@
* ```
*
* This is a slibc extension.
+ *
+ * @since Always.
*/
#define FAILABLE_CALL(expression) \
({ typeof(expression) __slibc_r = (expression); *__slibc_error_line() = __LINE__; __slibc_r; })
@@ -123,6 +125,8 @@
* that was the line that failed, if `condition`
* evaluates to non-zero.
* @return 1 if `condition` evaluates to non-zero, 0 otherwise.
+ *
+ * @since Always.
*/
#define FAILURE_CHECK(condition, offset) \
((condition) ? (*__slibc_error_line() = (__LINE__ - (offset)), 1) : 0)
@@ -168,6 +172,8 @@
* to describe what action failed. If the first argument is
* `NULL`, this is not printed and only the location of the
* error and `errno` is used to describe the error.
+ *
+ * @since Always.
*/
#define PRINT_FAILURE(...) \
(PRINT_CUSTOM_FAILURE(errno, NULL, __VA_ARGS__))
@@ -191,6 +197,8 @@
* to describe what action failed. If the first argument is
* `NULL`, this is not printed and only the location of the
* error and `error_string` is used to describe the error.
+ *
+ * @since Always.
*/
#define PRINT_CUSTOM_FAILURE(error_code, error_string, ...) \
(slibc_perror(NULL, __FILE__, *__slibc_error_line(), __func__, &(error_code), error_string, __VA_ARGS__))
@@ -198,6 +206,8 @@
/**
* Helper function to keep track of the line of origin, in a
* thread-safe manner, without requiring new revisions of C.
+ *
+ * @since Always.
*/
int* __slibc_error_line(void) __GCC_ONLY(__attribute__((__const__))); /* TODO not implemented */
@@ -222,6 +232,8 @@ int* __slibc_error_line(void) __GCC_ONLY(__attribute__((__const__))); /* TODO no
* @param format Formatting-string for a description of the action that failed. `NULL` if
* no description other than the location and `error_string` should be printed.
* @param ... Formatting-arguments for `format`.
+ *
+ * @since Always.
*/
void slibc_perror(const char*, const char*, int, const char*, int*, const char*, const char*, ...)
__GCC_ONLY(__attribute__((__nonnull__(2, 4), __format__(__slibc_printf__, 7, 8))));