2 Copyright © 1995-2013, The AROS Development Team. All rights reserved.
5 C99 assert() stdc.library support
7 #include <proto/exec.h>
8 #include <proto/intuition.h>
9 #include <aros/arossupportbase.h>
10 #include <intuition/intuition.h>
11 #include <aros/debug.h>
15 #include "__optionallibs.h"
17 /*****************************************************************************
30 This is a function that is used for implementation of the C99 assert()
34 expr - The expression to evaluate. The type of the expression does
35 not matter, only if its zero/NULL or not.
36 file - Name of the source file.
37 line - Line number of assert() call.
40 The function doesn't return.
43 Different versions of this function are available. This function
44 is used when a program is using stdc.library but not
45 stdcio.library or posixc.library.
46 Because no normal DOS file I/O is available an attempt will be made
47 to display the assertion in a requester and thus deviating from the
48 C99 standard that says it to go to the error stream.
59 ******************************************************************************/
61 if (__intuition_available())
63 struct EasyStruct es
=
65 sizeof(struct EasyStruct
),
67 (CONST_STRPTR
)"Failed Assertion",
68 (CONST_STRPTR
)"Assertion (%s) failed in %s:%u",
71 EasyRequest(NULL
, &es
, NULL
, expr
, file
, line
);
74 kprintf("Assertion (%s) failed in %s:%u", expr
, file
, line
);