File: minmax.h

package info (click to toggle)
atari-bootstrap 3.3-3
  • links: PTS
  • area: main
  • in suites: potato, woody
  • size: 468 kB
  • ctags: 528
  • sloc: ansic: 3,531; perl: 529; makefile: 115; sh: 26
file content (19 lines) | stat: -rw-r--r-- 342 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#ifndef _minmax_h
#define _minmax_h

#define	min(a,b)								\
    ({											\
		typeof(a) __a = (a);					\
		typeof(b) __b = (b);					\
		__a < __b ? __a : __b;					\
	})
	
#define	max(a,b)								\
    ({											\
		typeof(a) __a = (a);					\
		typeof(b) __b = (b);					\
		__a > __b ? __a : __b;					\
	})
	
#endif  /* _minmax_h */