Add ABS() macro (Absolute Value) to Base.h in MdePkg

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11818 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
mdkinney 2011-06-13 20:25:36 +00:00
parent 39840c50c1
commit 8b157410c1
1 changed files with 14 additions and 2 deletions

View File

@ -6,7 +6,7 @@
environment. There are a set of base libraries in the Mde Package that can environment. There are a set of base libraries in the Mde Package that can
be used to implement base modules. be used to implement base modules.
Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR> Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR> Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License are licensed and made available under the terms and conditions of the BSD License
@ -676,10 +676,22 @@ typedef UINTN *BASE_LIST;
@return Minimum of two operands. @return Minimum of two operands.
**/ **/
#define MIN(a, b) \ #define MIN(a, b) \
(((a) < (b)) ? (a) : (b)) (((a) < (b)) ? (a) : (b))
/**
Return the absolute value of a signed operand.
This macro returns the absolute value of the signed operand specified by a.
@param a The signed operand.
@return The absolute value of the signed operand.
**/
#define ABS(a) \
(((a) < 0) ? (-(a)) : (a))
// //
// Status codes common to all execution phases // Status codes common to all execution phases
// //