mirror of https://github.com/acidanthera/audk.git
Fix build of ShellC Lib/App for GCC.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8582 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
05db8d5506
commit
39157531c8
|
@ -17,11 +17,19 @@
|
|||
#include <Library/UefiLib.h>
|
||||
#include <Library/DebugLib.h>
|
||||
|
||||
INT32
|
||||
INTN
|
||||
EFIAPI
|
||||
main(
|
||||
UINTN Argc,
|
||||
CHAR16 **Argv
|
||||
){
|
||||
Print(L"Test Complete\r\n");
|
||||
ShellAppMain (
|
||||
IN INTN Argc,
|
||||
IN CHAR16 **Argv
|
||||
)
|
||||
{
|
||||
INTN Index;
|
||||
|
||||
Print(L"ShellCTestApp.c:ShellAppMain called with %d parameters\n", Argc);
|
||||
for (Index = 0; Index < Argc; Index++) {
|
||||
Print(L"Argv[%d]: %s\n", Index, Argv[Index]);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
|
@ -1,32 +0,0 @@
|
|||
/** @file
|
||||
Provides application point extension for "C" style main funciton
|
||||
|
||||
Copyright (c) 2006 - 2009, Intel Corporation
|
||||
All rights reserved. This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
**/
|
||||
|
||||
/**
|
||||
Intermediate entry point for the application that will in turn call into the "C"
|
||||
style main function.
|
||||
|
||||
this application must have a function defined as follows:
|
||||
INT32
|
||||
EFIAPI
|
||||
main(
|
||||
UINTN Argc,
|
||||
CHAR16 **Argv
|
||||
);
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
ShellCEntry(
|
||||
IN EFI_HANDLE ImageHandle,
|
||||
IN EFI_SYSTEM_TABLE *SystemTable
|
||||
);
|
|
@ -20,19 +20,33 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|||
|
||||
#include <Library/DebugLib.h>
|
||||
|
||||
INT32
|
||||
INTN
|
||||
EFIAPI
|
||||
main(
|
||||
UINTN Argc,
|
||||
CHAR16 **Argv
|
||||
);
|
||||
ShellAppMain (
|
||||
IN INTN Argc,
|
||||
IN CHAR16 **Argv
|
||||
);
|
||||
|
||||
/**
|
||||
UEFI entry point for an application that will in turn call a C
|
||||
style ShellAppMain function.
|
||||
|
||||
This application must have a function defined as follows:
|
||||
|
||||
INTN
|
||||
EFIAPI
|
||||
ShellAppMain (
|
||||
IN INTN Argc,
|
||||
IN CHAR16 **Argv
|
||||
);
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
ShellCEntryLib(
|
||||
ShellCEntryLib (
|
||||
IN EFI_HANDLE ImageHandle,
|
||||
IN EFI_SYSTEM_TABLE *SystemTable
|
||||
){
|
||||
)
|
||||
{
|
||||
INT32 ReturnFromMain;
|
||||
EFI_SHELL_PARAMETERS_PROTOCOL *EfiShellParametersProtocol;
|
||||
EFI_SHELL_INTERFACE *EfiShellInterface;
|
||||
|
@ -53,7 +67,10 @@ ShellCEntryLib(
|
|||
//
|
||||
// use shell 2.0 interface
|
||||
//
|
||||
ReturnFromMain = main(EfiShellInterface->Argc, EfiShellInterface->Argv);
|
||||
ReturnFromMain = ShellAppMain (
|
||||
EfiShellInterface->Argc,
|
||||
EfiShellInterface->Argv
|
||||
);
|
||||
} else {
|
||||
//
|
||||
// try to get shell 1.0 interface instead.
|
||||
|
@ -69,7 +86,10 @@ ShellCEntryLib(
|
|||
//
|
||||
// use shell 1.0 interface
|
||||
//
|
||||
ReturnFromMain = main(EfiShellParametersProtocol->Argc, EfiShellParametersProtocol->Argv);
|
||||
ReturnFromMain = ShellAppMain (
|
||||
EfiShellParametersProtocol->Argc,
|
||||
EfiShellParametersProtocol->Argv
|
||||
);
|
||||
} else {
|
||||
ASSERT(FALSE);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue