]> git.proxmox.com Git - mirror_edk2.git/blobdiff - StdLib/Include/sys/EfiCdefs.h
EADK (StdLib, AppPkg, StdLibPrivateInternalFiles): Python Beta Release.
[mirror_edk2.git] / StdLib / Include / sys / EfiCdefs.h
index 46aaf6e744f21ab8e212f988e884e18a9a95fdf7..be114ddbe487014b8a81863c01e4cfb41b5b8d88 100644 (file)
     that the library can be easily tuned for different compilers.\r
     __inline    Defined to the appropriate keyword or not defined.\r
     __func__    Defined to __FUNC__, __FUNCTION__, or NULL as appropriate.\r
-    __restrict  Defined to nothing for VC++ or to restrict for C99 compliant compilers.\r
+    __restrict  Defined to nothing for VC++ or to restrict for GCC and C99 compliant compilers.\r
 \r
     This file and its contents are inspired by the <sys/cdefs.h> files in Berkeley\r
     Unix.  They have been re-implemented to be specific to the EFI environment.\r
 \r
-    Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>\r
+    Copyright (c) 2010 - 2012, Intel Corporation. All rights reserved.<BR>\r
     This program and the accompanying materials are licensed and made available under\r
     the terms and conditions of the BSD License that accompanies this distribution.\r
     The full text of the license may be found at\r
-    http://opensource.org/licenses/bsd-license.php.\r
+    http://opensource.org/licenses/bsd-license.\r
 \r
     THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
     WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
   //#define _EFI_WINT_MIN     (0)\r
   //#define _EFI_WINT_MAX     (0xFFFF)\r
   #define _EFI_PTRDIFF_T_   __PTRDIFF_TYPE__  /* ptr1 - ptr2 --- Must be same size as size_t */\r
+\r
 #else\r
 #define _EFI_SIZE_T_      UINTN       /* sizeof() */\r
 #define _EFI_WCHAR_T      UINT16\r
   #endif\r
 #endif /* !(__STDC_VERSION__ >= 199901L) */\r
 \r
-// <DVM 12/21/2010> Experiment to disable RENAME for GCC\r
-#if  0\r
-#ifdef __GNUC__\r
-  #define __RENAME(x) ___RENAME(x)\r
-#else\r
-  #ifdef __lint__\r
-    #define __RENAME(x) __symbolrename(x)\r
-  #else\r
-    /*DVM To see where this might be used... */\r
-    //#error "No function renaming possible"\r
-    #define __RENAME(x)\r
-  #endif /* __lint__ */\r
-#endif /* __GNUC__ */\r
-#else /* if 0 */\r
-  #define __RENAME(x)\r
-#endif  /* if 0 */\r
+#define __RENAME(x)\r
 \r
   /*\r
   * A barrier to stop the optimizer from moving code or assume live\r
   #error You must specify /Zc:wchar_t- to the compiler to turn off intrinsic wchar_t.\r
   #endif\r
 \r
+  /* Get rid of pre-defined macros that are misleading in this environment. */\r
+  #undef  _WIN32\r
+  #undef  _WIN64\r
+\r
   // Keep compiler quiet about casting from smaller to larger types\r
   #pragma warning ( disable : 4306 )\r
 #endif  /* defined(_MSC_VER) */\r
@@ -353,15 +343,29 @@ extern int _fltused;    // VC++ requires this if you use floating point.  KEEP f
 #define _DIAGASSERT(e)\r
 \r
 // Types used to replace long so that it will have constant length regardless of compiler.\r
-typedef  INT32   EFI_LONG_T;  // Equivalent to long in VS200?\r
-typedef UINT32  EFI_ULONG_T;  // Equivalent to unsigned long in VS200?\r
-typedef INTN     LONGN;\r
-typedef UINTN   ULONGN;\r
-typedef INT32    LONG32;\r
+typedef  INT32   LONG32;\r
 typedef UINT32  ULONG32;\r
 typedef  INT64   LONG64;\r
 typedef UINT64  ULONG64;\r
 \r
-//extern int EFIAPI main();\r
+typedef   INTN   EFI_LONG_T;\r
+typedef  UINTN   EFI_ULONG_T;\r
+\r
+/* These types reflect the compiler's size for long */\r
+#if defined(__GNUC__)\r
+  #if __GNUC_PREREQ__(4,4)\r
+    /* GCC 4.4 or later */\r
+    typedef   INT64   LONGN;\r
+    typedef  UINT64   ULONGN;\r
+  #else\r
+    /* minGW gcc variant */\r
+    typedef   INT32   LONGN;\r
+    typedef  UINT32   ULONGN;\r
+  #endif  /* __GNUC_PREREQ__(4,4) */\r
+#else   /* NOT GCC */\r
+  /* Microsoft or Intel compilers */\r
+  typedef   INT32   LONGN;\r
+  typedef  UINT32   ULONGN;\r
+#endif  /* defined(__GNUC__) */\r
 \r
 #endif  /* _EFI_CDEFS_H */\r