aboutsummaryrefslogtreecommitdiff
path: root/src/utils.h
blob: d4d451f635a1154c314422b8a738944bddd0adf8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#ifndef INCLUDED_UTILS_H
#define INCLUDED_UTILS_H

#include <assert.h>
#include <stdlib.h>

#define MALLOC malloc
#define REALLOC realloc
#define FREE free
#define ASSERT assert

#define PRINT_EXP(EXP, FMT) printf (#EXP" = "FMT"\n", EXP)

#define SWAP(A, B)              \
  ({                            \
    typeof (A) tmp = (A);       \
    (A) = (B);                  \
    (B) = tmp;                  \
  })

#endif