summaryrefslogtreecommitdiff
path: root/macros.h
blob: 14e7da00e49bb030a60f81390726f98a907395d3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#ifndef MACROS_H
#define MACROS_H

#define min(a, b) (((a) < (b)) ? (a) : (b))
#define max(a, b) (((a) > (b)) ? (a) : (b))

#define const_strlen(str) sizeof((char []){str})

#ifndef LOG_H
#include "log.h"

#define log(priority, ...) printlog(LOG_OUT_SYSLOG, priority, __VA_ARGS__)
#define log_reason(priority, msg, ...) log(priority, msg " Reason %s", __VA_ARGS__)
#endif

#endif