Revision: 16388
          http://sourceforge.net/p/edk2/code/16388
Author:   lersek
Date:     2014-11-14 10:24:33 +0000 (Fri, 14 Nov 2014)
Log Message:
-----------
CryptoPkg: OpenSslSupport.h: edk2-ize offsetof() macro for gcc-4.8 / X64

Code added in SVN r16339 ("CryptoPkg Updates to support RFC3161 timestamp
signature verification.") introduced many new uses of the offsetof()
macro. Since the offsetof() macro in "OpenSslSupport.h" casts a pointer to
an "int", it triggers a large number of

  error: cast from pointer to integer of different size
  [-Werror=pointer-to-int-cast]

errors when building CryptoPkg with gcc-4.8 for X64.

Remedy this by directing offsetof() to the OFFSET_OF() macro in
"MdePkg/Include/Base.h" (which matches how "OpenSslSupport.h" resolves the
va_*() macros too).

Contributed-under: TianoCore Contribution Agreement 1.0

Signed-off-by: Laszlo Ersek <[email protected]>

Build-tested-by: Scott Duplichan <[email protected]>

Reviewed-by: Jordan Justen <[email protected]>

Reviewed-by: Qin Long <[email protected]>

Revision Links:
--------------
    http://sourceforge.net/p/edk2/code/16339

Modified Paths:
--------------
    trunk/edk2/CryptoPkg/Include/OpenSslSupport.h

Modified: trunk/edk2/CryptoPkg/Include/OpenSslSupport.h
===================================================================
--- trunk/edk2/CryptoPkg/Include/OpenSslSupport.h       2014-11-14 10:24:21 UTC 
(rev 16387)
+++ trunk/edk2/CryptoPkg/Include/OpenSslSupport.h       2014-11-14 10:24:33 UTC 
(rev 16388)
@@ -72,7 +72,7 @@
    portably, hence it is provided by a Standard C header file.
    For pre-Standard C compilers, here is a version that usually works
    (but watch out!): */
-#define offsetof(type, member) ( (int) & ((type*)0) -> member )
+#define offsetof(type, member) OFFSET_OF (type, member)
 
 //
 // Basic types from EFI Application Toolkit required to buiild Open SSL


------------------------------------------------------------------------------
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://pubads.g.doubleclick.net/gampad/clk?id=154624111&iu=/4140/ostg.clktrk
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to