]> git.proxmox.com Git - mirror_edk2.git/blob - StdLib/LibC/Main/assert.c
Standard Libraries for EDK II.
[mirror_edk2.git] / StdLib / LibC / Main / assert.c
1 /**
2 Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>
3 This program and the accompanying materials are licensed and made available under
4 the terms and conditions of the BSD License that accompanies this distribution.
5 The full text of the license may be found at
6 http://opensource.org/licenses/bsd-license.php.
7
8 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
9 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
10 **/
11 //#include <Uefi.h>
12 //#include <Library/UefiLib.h>
13
14 #include <LibConfig.h>
15 #include <sys/EfiCdefs.h>
16
17 #include <stdio.h>
18 #include <stdlib.h>
19
20 void
21 EFIAPI
22 __assert(const char *func, const char *file, int line, const char *failedexpr)
23 {
24 if (func == NULL)
25 printf("Assertion failed: (%s), file %s, line %d.\n",
26 failedexpr, file, line);
27 else
28 printf("Assertion failed: (%s), function %s, file %s, line %d.\n",
29 failedexpr, func, file, line);
30 abort();
31 /* NOTREACHED */
32 }