From: mdkinney Date: Mon, 13 Jun 2011 20:25:36 +0000 (+0000) Subject: Add ABS() macro (Absolute Value) to Base.h in MdePkg X-Git-Tag: edk2-stable201903~14689 X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=commitdiff_plain;h=8b157410c1f57f684f049ee7b7989b8065be8f11 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 --- diff --git a/MdePkg/Include/Base.h b/MdePkg/Include/Base.h index e93f681155..cd860acd91 100644 --- a/MdePkg/Include/Base.h +++ b/MdePkg/Include/Base.h @@ -6,7 +6,7 @@ environment. There are a set of base libraries in the Mde Package that can be used to implement base modules. -Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.
+Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.
Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
This program and the accompanying materials 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. **/ - #define MIN(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 //