fiu-local.h revision a74702c6
1a74702c6SGeorge Wang/* Copyright (c) 2017 - 2022 LiteSpeed Technologies Inc.  See LICENSE. */
250aadb33SDmitri Tikhonov
350aadb33SDmitri Tikhonov/* libfiu - Fault Injection in Userspace
450aadb33SDmitri Tikhonov *
550aadb33SDmitri Tikhonov * This header, part of libfiu, is meant to be included in your project to
650aadb33SDmitri Tikhonov * avoid having libfiu as a mandatory build-time dependency.
750aadb33SDmitri Tikhonov *
850aadb33SDmitri Tikhonov * You can add it to your project, and #include it instead of fiu.h.
950aadb33SDmitri Tikhonov * The real fiu.h will be used only when FIU_ENABLE is defined.
1050aadb33SDmitri Tikhonov *
1150aadb33SDmitri Tikhonov * This header, as the rest of libfiu, is in the public domain.
1250aadb33SDmitri Tikhonov *
1350aadb33SDmitri Tikhonov * You can find more information about libfiu at
1450aadb33SDmitri Tikhonov * http://blitiri.com.ar/p/libfiu.
1550aadb33SDmitri Tikhonov */
1650aadb33SDmitri Tikhonov
1750aadb33SDmitri Tikhonov#ifndef _FIU_LOCAL_H
1850aadb33SDmitri Tikhonov#define _FIU_LOCAL_H
1950aadb33SDmitri Tikhonov
2050aadb33SDmitri Tikhonov/* Only define the stubs when fiu is disabled, otherwise use the real fiu.h
2150aadb33SDmitri Tikhonov * header */
2250aadb33SDmitri Tikhonov#ifndef FIU_ENABLE
2350aadb33SDmitri Tikhonov
2450aadb33SDmitri Tikhonov#define fiu_init(flags) 0
2550aadb33SDmitri Tikhonov#define fiu_fail(name) 0
2650aadb33SDmitri Tikhonov#define fiu_failinfo() NULL
2750aadb33SDmitri Tikhonov#define fiu_do_on(name, action)
2850aadb33SDmitri Tikhonov#define fiu_exit_on(name)
2950aadb33SDmitri Tikhonov#define fiu_return_on(name, retval)
3050aadb33SDmitri Tikhonov
3150aadb33SDmitri Tikhonov#else
3250aadb33SDmitri Tikhonov
3350aadb33SDmitri Tikhonov#include <fiu.h>
3450aadb33SDmitri Tikhonov
3550aadb33SDmitri Tikhonov#endif /* FIU_ENABLE */
3650aadb33SDmitri Tikhonov
3750aadb33SDmitri Tikhonov#endif /* _FIU_LOCAL_H */
3850aadb33SDmitri Tikhonov
39