#ifndef lib_blame_h #define lib_blame_h /* Cesar project {{{ * * Copyright (C) 2009 Spidcom * * <<>> * * }}} */ /** * \file lib/blame.h * \brief Blame the function caller. * \ingroup lib * * Some API are subject to bad treatments from user code, but when a false * assertion occurs, there is no way to reject the fault on the caller. * * This module provide a mechanism to blame the function caller for its bad * behaviour. * * It provides the following macros to pass function and line of the caller: * * - FL macros for function declarations ; * - fL macros to insert information relative to this function ; * - fl macros to insert information relative to the caller. */ #include "config/blame.h" #include "config/restrack.h" /* Macro helpers. */ #if CONFIG_BLAME || CONFIG_RESTRACK # define _FL const char *function, int line # define void_FL _FL # define __FL , _FL # define _fL __func__, __LINE__ # define __fL , _fL # define _fl function, line # define __fl , _fl # define _fl_ function, line #else /* !(CONFIG_BLAME || CONFIG_RESTRACK) */ # define _FL # define void_FL void # define __FL # define _fL # define __fL # define _fl # define __fl # define _fl_ NULL, 0 #endif /* !(CONFIG_BLAME || CONFIG_RESTRACK) */ #endif /* lib_blame_h */