source: trunk/src/win32k/include/macros.h@ 5087

Last change on this file since 5087 was 4164, checked in by bird, 25 years ago

Merged in the Grace branch. New Win32k!

File size: 996 bytes
Line 
1/* $Id: macros.h,v 1.3 2000-09-02 21:08:02 bird Exp $
2 *
3 * Common macros for Win32k/Elf.
4 *
5 * Copyright (c) 2000 knut st. osmundsen
6 *
7 * Project Odin Software License can be found in LICENSE.TXT
8 *
9 */
10
11#ifndef _MACROS_H_
12#define _MACROS_H_
13
14
15#define MAX(a, b) (((a) > (b))? (a) : (b))
16#define MIN(a, b) (((a) < (b))? (a) : (b))
17#define MINNOTNULL(a, b) ((a) != NULL && (b) != NULL ? MIN(a,b) : ((a) != NULL ? (a) : (b)))
18#define MAXNOTNULL(a, b) ((a) != NULL && (b) != NULL ? MAX(a,b) : ((a) != NULL ? (a) : (b)))
19
20/*
21 * Aligns something, a, up to nearest alignment boundrary-
22 * Note: Aligment must be a 2**n number.
23 */
24#define ALIGN(a, alignment) (((a) + (alignment - 1UL)) & ~(alignment - 1UL))
25
26/*
27 * Not referenced parameter warning fix.
28 */
29#define NOREF(a) (a=a)
30
31/*
32 * Makes an unsigned long from 4 (unsigned or signed) chars.
33 */
34#define MAKEULONG4(ch1, ch2, ch3, ch4) \
35 ((ULONG)(MAKEULONG(MAKEUSHORT(ch1, ch2), MAKEUSHORT(ch3, ch4))))
36
37#endif
Note: See TracBrowser for help on using the repository browser.