Browse Source

From: Pete Batard <pete@akeo.ie>
Date: Wed, 16 Sep 2015 18:26:28 +0100
Subject: [PATCH] Fix VS2015 warnings

* Currently, Visual Studio 2015 generates a lot of warnings such as:
gnu-efi\inc\efipciio.h(7): warning C4091: 'typedef ': ignored on left of '_EFI_PCI_IO' when no variable is declared
* To address this, gnu-efi should define the INTERFACE_DECL() for MS compilers as it does for GNU

Signed-off-by: Pete Batard <pete@akeo.ie>
Signed-off-by: Nigel Croxon <nigel.croxon@hpe.com>

Nigel Croxon 9 years ago
parent
commit
0b5f181a36
3 changed files with 3 additions and 3 deletions
  1. 1 1
      inc/ia32/efibind.h
  2. 1 1
      inc/ia64/efibind.h
  3. 1 1
      inc/x86_64/efibind.h

+ 1 - 1
inc/ia32/efibind.h

@@ -272,7 +272,7 @@ typedef uint32_t   UINTN;
 #ifdef NO_INTERFACE_DECL
 #ifdef NO_INTERFACE_DECL
 #define INTERFACE_DECL(x)
 #define INTERFACE_DECL(x)
 #else
 #else
-#ifdef __GNUC__
+#if defined(__GNUC__) || defined(_MSC_EXTENSIONS)
 #define INTERFACE_DECL(x) struct x
 #define INTERFACE_DECL(x) struct x
 #else
 #else
 #define INTERFACE_DECL(x) typedef struct x
 #define INTERFACE_DECL(x) typedef struct x

+ 1 - 1
inc/ia64/efibind.h

@@ -219,7 +219,7 @@ void __mf (void);
 #ifdef NO_INTERFACE_DECL
 #ifdef NO_INTERFACE_DECL
 #define INTERFACE_DECL(x)
 #define INTERFACE_DECL(x)
 #else
 #else
-#ifdef __GNUC__
+#if defined(__GNUC__) || defined(_MSC_EXTENSIONS)
 #define INTERFACE_DECL(x) struct x
 #define INTERFACE_DECL(x) struct x
 #else
 #else
 #define INTERFACE_DECL(x) typedef struct x
 #define INTERFACE_DECL(x) typedef struct x

+ 1 - 1
inc/x86_64/efibind.h

@@ -284,7 +284,7 @@ typedef uint64_t   UINTN;
 #ifdef NO_INTERFACE_DECL
 #ifdef NO_INTERFACE_DECL
 #define INTERFACE_DECL(x)
 #define INTERFACE_DECL(x)
 #else
 #else
-#ifdef __GNUC__
+#if defined(__GNUC__) || defined(_MSC_EXTENSIONS)
 #define INTERFACE_DECL(x) struct x
 #define INTERFACE_DECL(x) struct x
 #else
 #else
 #define INTERFACE_DECL(x) typedef struct x
 #define INTERFACE_DECL(x) typedef struct x