don't warn noisely if loading multiple module aliases
[mit.git] / logging.h
blobc022d66eff69999ee583779ecc44f83a1ceb075b
1 #ifndef MODINITTOOLS_LOGGING_H
2 #define MODINITTOOLS_LOGGING_H
4 /* Do we use syslog for messages or stderr? */
5 extern int logging;
7 /* Number of times warn() has been called */
8 extern int warned;
10 void fatal(const char *fmt, ...);
11 void warn(const char *fmt, ...);
13 #define NOFAIL(ptr) do_nofail((ptr), __FILE__, __LINE__, #ptr)
15 static inline void *do_nofail(void *ptr, const char *file, int line, const char *expr)
17 if (!ptr) {
18 fatal("Memory allocation failure %s line %d: %s.\n",
19 file, line, expr);
21 return ptr;
24 #endif /* MODINITTOOLS_LOGGING_H */