source: buchla-68k/include/macros.h@ 4b63bf3

Last change on this file since 4b63bf3 was f7428b1, checked in by Thomas Lopatic <thomas@…>, 7 years ago

Started to rework include files.

  • Property mode set to 100644
File size: 547 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#pragma once
11
12#define abs(x) ((x) < 0 ? -(x) : (x))
13#define sign(x, y) ((x) < 0 ? -(y) : (y))
14
15#define min(x, y) ((x) > (y) ? (y) : (x))
16#define max(x, y) ((x) > (y) ? (x) : (y))
17
18#define inrange(var, lo, hi) \
19 (((var) >= (lo)) && ((var) <= (hi)))
Note: See TracBrowser for help on using the repository browser.