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

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

Changed and hopefully corrected code identifying the kernel type.

File size: 925 bytes
Line 
1/* $Id: macros.h,v 1.2 2000-05-03 10:46:07 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/*
28 * Makes an unsigned long from 4 (unsigned or signed) chars.
29 */
30#define MAKEULONG4(ch1, ch2, ch3, ch4) \
31 ((ULONG)(MAKEULONG(MAKEUSHORT(ch1, ch2), MAKEUSHORT(ch3, ch4))))
32
33#endif
Note: See TracBrowser for help on using the repository browser.