common.h revision a86d55da8bf41335aa2fc5ec16ca63859d918e81
1/* 2 * 3 * Various things common for all utilities 4 * 5 */ 6 7#ifndef __QUOTA_COMMON_H__ 8#define __QUOTA_COMMON_H__ 9 10#ifndef __attribute__ 11# if !defined __GNUC__ || __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 8) || __STRICT_ANSI__ 12# define __attribute__(x) 13# endif 14#endif 15 16#define log_err(format, ...) fprintf(stderr, \ 17 "[ERROR] %s:%d:%s:: " format "\n", \ 18 __FILE__, __LINE__, __func__, __VA_ARGS__) 19 20#ifdef DEBUG_QUOTA 21# define log_debug(format, ...) fprintf(stderr, \ 22 "[DEBUG] %s:%d:%s:: " format "\n", \ 23 __FILE__, __LINE__, __func__, __VA_ARGS__) 24#else 25# define log_debug(format, ...) 26#endif 27 28#endif /* __QUOTA_COMMON_H__ */ 29