-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathutil.h
42 lines (33 loc) · 1.01 KB
/
util.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/*
* General helper functions and defines
*
* ------------------------------------------------
*
* Copyright (C) 2020 Paul Kurucz
*
* License info: See the LICENSE file at the repo top level
*
* THIS SOFTWARE IS PROVIDED IN AN "AS IS" CONDITION. NO WARRANTIES,
* WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT NOT LIMITED
* TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
* PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. THE COMPANY SHALL NOT,
* IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL OR
* CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
*
*/
#include <stdbool.h>
#include <stdint.h>
#ifndef _UTIL_H
#define _UTIL_H
/* ----------------------------------------------------- */
#ifndef MIN
#define MIN(_A, _B) ( ((_A) < (_B)) ? (_A) : (_B) )
#endif
#ifndef MAX
#define MAX(_A, _B) ( ((_A) > (_B)) ? (_A) : (_B) )
#endif
#ifndef NUMEL
#define NUMEL(_X) ( sizeof((_X)) / sizeof((_X)[0]) )
#endif
/* ----------------------------------------------------- */
#endif /* _UTIL_H */