File: common.h

package info (click to toggle)
vor 0.5.7-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 1,284 kB
  • ctags: 400
  • sloc: ansic: 2,222; sh: 345; makefile: 112
file content (24 lines) | stat: -rw-r--r-- 429 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#ifndef VOR_COMMON_H
#define VOR_COMMON_H

#include <stdbool.h>
#include <stddef.h>

#define NONE (~0)

#ifndef max
#define max(a, b) ((a) > (b) ? (a) : (b))
#endif

#ifndef min
#define min(a, b) ((a) < (b) ? (a) : (b))
#endif

#ifndef abs
#define abs(a) ((a)<=0 ? -(a) : (a))
#endif

#define CONDERROR(a) if((a)) {initerror = strdup(SDL_GetError());return 1;}
#define NULLERROR(a) CONDERROR((a) == NULL)

#endif // VOR_COMMON_H