In one of the next patches, we'll introduce ARRAY_SIZE in
"MdePkg/Include/Base.h". In order to proceed in small steps, make the
module-local definition of ARRAY_SIZE conditional. This way the
introduction of the macro under MdePkg will silently switch this module
over (after which we can remove the module-local definition completely).

Cc: Cecil Sheng <cecil.sh...@hpe.com>
Cc: Feng Tian <feng.t...@intel.com>
Cc: Star Zeng <star.z...@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <ler...@redhat.com>
---
 MdeModulePkg/Universal/RegularExpressionDxe/RegularExpressionDxe.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/MdeModulePkg/Universal/RegularExpressionDxe/RegularExpressionDxe.h 
b/MdeModulePkg/Universal/RegularExpressionDxe/RegularExpressionDxe.h
index b3f70136d8d3..73ea92b5a178 100644
--- a/MdeModulePkg/Universal/RegularExpressionDxe/RegularExpressionDxe.h
+++ b/MdeModulePkg/Universal/RegularExpressionDxe/RegularExpressionDxe.h
@@ -26,7 +26,9 @@
 #include <Library/DebugLib.h>
 #include <Library/BaseLib.h>
 
+#ifndef ARRAY_SIZE
 #define ARRAY_SIZE(Array) (sizeof(Array) / sizeof(*Array))
+#endif
 
 /**
   Checks if the input string matches to the regular expression pattern.
-- 
2.9.2


_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to