source: buchla-68k/include/macros.h@ 9bf0f86

Last change on this file since 9bf0f86 was f40a309, checked in by Thomas Lopatic <thomas@…>, 7 years ago

Unix line breaks.

  • Property mode set to 100644
File size: 625 bytes
Line 
1/*
2 =============================================================================
3 macros.h -- utility macros
4 Version 3 -- 1988-10-19 -- D.N. Lynx Crowe
5
6 All of the usual comments about side-effects apply.
7 =============================================================================
8*/
9
10#ifndef abs
11#define abs(x) ((x) < 0 ? -(x) : (x))
12#endif
13
14#ifndef sign
15#define sign(x,y) ((x) < 0 ? -(y) : (y))
16#endif
17
18#ifndef min
19#define min(x,y) ((x) > (y) ? (y) : (x))
20#endif
21
22#ifndef max
23#define max(x,y) ((x) > (y) ? (x) : (y))
24#endif
25
26#ifndef inrange
27#define inrange(var,lo,hi) (((var) >= (lo)) && ((var) <= (hi)))
28#endif
Note: See TracBrowser for help on using the repository browser.