diff mbox

[edk2,02/47] NetworkPkg/IpsecConfig: guard the definition of ARRAY_SIZE

Message ID 20161026190504.9888-3-lersek@redhat.com
State Superseded
Headers show

Commit Message

Laszlo Ersek Oct. 26, 2016, 7:04 p.m. UTC
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: Jiaxin Wu <jiaxin.wu@intel.com>
Cc: Siyuan Fu <siyuan.fu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>

---
 NetworkPkg/Application/IpsecConfig/IpSecConfig.h | 2 ++
 1 file changed, 2 insertions(+)

-- 
2.9.2


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

Comments

Fu, Siyuan Oct. 27, 2016, 1:59 a.m. UTC | #1
Reviewed-by: Fu Siyuan siyuan.fu@intel.com



> -----Original Message-----

> From: Laszlo Ersek [mailto:lersek@redhat.com]

> Sent: Thursday, October 27, 2016 3:04 AM

> To: edk2-devel-01 <edk2-devel@ml01.01.org>

> Cc: Wu, Jiaxin <jiaxin.wu@intel.com>; Fu, Siyuan <siyuan.fu@intel.com>

> Subject: [PATCH 02/47] NetworkPkg/IpsecConfig: guard the definition of

> ARRAY_SIZE

> 

> 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: Jiaxin Wu <jiaxin.wu@intel.com>

> Cc: Siyuan Fu <siyuan.fu@intel.com>

> Contributed-under: TianoCore Contribution Agreement 1.0

> Signed-off-by: Laszlo Ersek <lersek@redhat.com>

> ---

>  NetworkPkg/Application/IpsecConfig/IpSecConfig.h | 2 ++

>  1 file changed, 2 insertions(+)

> 

> diff --git a/NetworkPkg/Application/IpsecConfig/IpSecConfig.h

> b/NetworkPkg/Application/IpsecConfig/IpSecConfig.h

> index 8ebc599a12e7..79a436a7b3b2 100644

> --- a/NetworkPkg/Application/IpsecConfig/IpSecConfig.h

> +++ b/NetworkPkg/Application/IpsecConfig/IpSecConfig.h

> @@ -27,7 +27,9 @@

> 

>  #include <Protocol/IpSecConfig.h>

> 

> +#ifndef ARRAY_SIZE

>  #define ARRAY_SIZE(x) (sizeof(x) / sizeof(x[0]))

> +#endif

> 

>  #define IPSECCONFIG_STATUS_NAME    L"IpSecStatus"

> 

> --

> 2.9.2

> 


_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
Wu, Jiaxin Oct. 27, 2016, 2:30 a.m. UTC | #2
Reviewed-By: Wu Jiaxin <jiaxin.wu@intel.com>


Best Regards!
Jiaxin

> -----Original Message-----

> From: Laszlo Ersek [mailto:lersek@redhat.com]

> Sent: Thursday, October 27, 2016 3:04 AM

> To: edk2-devel-01 <edk2-devel@ml01.01.org>

> Cc: Wu, Jiaxin <jiaxin.wu@intel.com>; Fu, Siyuan <siyuan.fu@intel.com>

> Subject: [PATCH 02/47] NetworkPkg/IpsecConfig: guard the definition of

> ARRAY_SIZE

> 

> 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: Jiaxin Wu <jiaxin.wu@intel.com>

> Cc: Siyuan Fu <siyuan.fu@intel.com>

> Contributed-under: TianoCore Contribution Agreement 1.0

> Signed-off-by: Laszlo Ersek <lersek@redhat.com>

> ---

>  NetworkPkg/Application/IpsecConfig/IpSecConfig.h | 2 ++

>  1 file changed, 2 insertions(+)

> 

> diff --git a/NetworkPkg/Application/IpsecConfig/IpSecConfig.h

> b/NetworkPkg/Application/IpsecConfig/IpSecConfig.h

> index 8ebc599a12e7..79a436a7b3b2 100644

> --- a/NetworkPkg/Application/IpsecConfig/IpSecConfig.h

> +++ b/NetworkPkg/Application/IpsecConfig/IpSecConfig.h

> @@ -27,7 +27,9 @@

> 

>  #include <Protocol/IpSecConfig.h>

> 

> +#ifndef ARRAY_SIZE

>  #define ARRAY_SIZE(x) (sizeof(x) / sizeof(x[0]))

> +#endif

> 

>  #define IPSECCONFIG_STATUS_NAME    L"IpSecStatus"

> 

> --

> 2.9.2

> 


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

Patch

diff --git a/NetworkPkg/Application/IpsecConfig/IpSecConfig.h b/NetworkPkg/Application/IpsecConfig/IpSecConfig.h
index 8ebc599a12e7..79a436a7b3b2 100644
--- a/NetworkPkg/Application/IpsecConfig/IpSecConfig.h
+++ b/NetworkPkg/Application/IpsecConfig/IpSecConfig.h
@@ -27,7 +27,9 @@ 
 
 #include <Protocol/IpSecConfig.h>
 
+#ifndef ARRAY_SIZE
 #define ARRAY_SIZE(x) (sizeof(x) / sizeof(x[0]))
+#endif
 
 #define IPSECCONFIG_STATUS_NAME    L"IpSecStatus"