]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Add ABS() macro (Absolute Value) to Base.h in MdePkg
authormdkinney <mdkinney@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 13 Jun 2011 20:25:36 +0000 (20:25 +0000)
committermdkinney <mdkinney@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 13 Jun 2011 20:25:36 +0000 (20:25 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11818 6f19259b-4bc3-4df7-8a09-765794883524

MdePkg/Include/Base.h

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