summaryrefslogtreecommitdiffstats
path: root/MdePkg/Include/Base.h
diff options
context:
space:
mode:
authormdkinney <mdkinney@6f19259b-4bc3-4df7-8a09-765794883524>2011-06-13 20:25:36 +0000
committermdkinney <mdkinney@6f19259b-4bc3-4df7-8a09-765794883524>2011-06-13 20:25:36 +0000
commit8b157410c1f57f684f049ee7b7989b8065be8f11 (patch)
treeca63f9184bfef254937159869eb407f1f786b047 /MdePkg/Include/Base.h
parent39840c50c1a7cc727fb60cce044b0e956f94deb3 (diff)
downloadedk2-8b157410c1f57f684f049ee7b7989b8065be8f11.tar.gz
edk2-8b157410c1f57f684f049ee7b7989b8065be8f11.tar.bz2
edk2-8b157410c1f57f684f049ee7b7989b8065be8f11.zip
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
Diffstat (limited to 'MdePkg/Include/Base.h')
-rw-r--r--MdePkg/Include/Base.h16
1 files changed, 14 insertions, 2 deletions
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.<BR>
+Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
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
//