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
RevLine 
[f40a309]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
[f7428b1]10#pragma once
[f40a309]11
[f7428b1]12#define abs(x) ((x) < 0 ? -(x) : (x))
13#define sign(x, y) ((x) < 0 ? -(y) : (y))
[f40a309]14
[f7428b1]15#define min(x, y) ((x) > (y) ? (y) : (x))
16#define max(x, y) ((x) > (y) ? (x) : (y))
[f40a309]17
[f7428b1]18#define inrange(var, lo, hi) \
19 (((var) >= (lo)) && ((var) <= (hi)))
Note: See TracBrowser for help on using the repository browser.