EDK II C Coding Standards spec seems to not recommend redefinition of typedefs. 
Since it's not supported by C89 and C99, I'd rather avoid it.

Paulo

-----Original Message-----
From: edk2-devel [mailto:[email protected]] On Behalf Of Andrew 
Fish
Sent: terça-feira, 15 de março de 2016 15:06
To: edk2-devel <[email protected]>
Subject: [edk2] [MdeModulePkg] Do we support redefinition of typedefs?

Xcode clang seems unhappy with both FileExplorerLib.h and 
Protocol/FileExplorer.h both defining CHOOSE_HANDLER

/Users/andrewfish/work/src/edk2/MdeModulePkg/Include/Library/FileExplorerLib.h:30:10:
 error: redefinition of typedef 'CHOOSE_HANDLER' is a C11 feature 
[-Werror,-Wtypedef-redefinition] (EFIAPI *CHOOSE_HANDLER)(
         ^
/Users/andrewfish/work/src/edk2/MdeModulePkg/Include/Protocol/FileExplorer.h:39:10:
 note: previous definition is here (EFIAPI *CHOOSE_HANDLER)(
         ^
1 error generated.

Should Library/FileExplorerLib.h include Protocol/FileExplorer.h to get the 
definition of CHOOSE_HANDLER?

diff --git a/MdeModulePkg/Include/Library/FileExplorerLib.h 
b/MdeModulePkg/Include/Library/FileExplorerLib.h
index afb0dc8..2ae8ec6 100644
--- a/MdeModulePkg/Include/Library/FileExplorerLib.h
+++ b/MdeModulePkg/Include/Library/FileExplorerLib.h
@@ -16,20 +16,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER 
EXPRESS OR IMPLIED.
 #ifndef __FILE_EXPLORER_LIB_H__
 #define __FILE_EXPLORER_LIB_H__
 
-/**
-  Prototype for the next process after user chosed one file.
-
-  @param[in] FilePath     The device path of the find file.
-
-  @retval    TRUE         Need exit file explorer after do the extra task.
-  @retval    FALSE        Not need to exit file explorer after do the extra 
task.
-
-**/
-typedef
-BOOLEAN
-(EFIAPI *CHOOSE_HANDLER)(
-  IN EFI_DEVICE_PATH_PROTOCOL  *FilePath
-  );
+#include <Protocol/FileExplorer.h>
 
 /**
   Choose a file in the specified directory. 

Contributed-under: TianoCore Contribution Agreement 1.0

Thanks,

Andrew Fish
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.01.org/mailman/listinfo/edk2-devel
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to