debug-internal.h 576 B

123456789101112131415161718192021
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef __API_DEBUG_INTERNAL_H__
  3. #define __API_DEBUG_INTERNAL_H__
  4. #include "debug.h"
  5. #define __pr(func, fmt, ...) \
  6. do { \
  7. if ((func)) \
  8. (func)("libapi: " fmt, ##__VA_ARGS__); \
  9. } while (0)
  10. extern libapi_print_fn_t __pr_warn;
  11. extern libapi_print_fn_t __pr_info;
  12. extern libapi_print_fn_t __pr_debug;
  13. #define pr_warn(fmt, ...) __pr(__pr_warn, fmt, ##__VA_ARGS__)
  14. #define pr_info(fmt, ...) __pr(__pr_info, fmt, ##__VA_ARGS__)
  15. #define pr_debug(fmt, ...) __pr(__pr_debug, fmt, ##__VA_ARGS__)
  16. #endif /* __API_DEBUG_INTERNAL_H__ */