]> 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 c3a2772bfc202a75254fe3f18d124db573bc5204..be114ddbe487014b8a81863c01e4cfb41b5b8d88 100644 (file)
@@ -22,7 +22,7 @@
     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 - 2011, 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
   //#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
   #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
@@ -338,13 +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
+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