1ASSERT(3)                       Allegro manual                       ASSERT(3)
2
3
4

NAME

6       ASSERT  -  Debugging  helper  macro to assert. Allegro game programming
7       library.
8

SYNOPSIS

10       #include <allegro.h>
11
12
13       void ASSERT(condition);
14

DESCRIPTION

16       Debugging helper macro. Normally compiles away to nothing, but  if  you
17       defined  the  preprocessor  symbol  DEBUGMODE  before including Allegro
18       headers, it will check the supplied condition and call  al_assert()  if
19       it  fails,  whose  default action is to stop the program and report the
20       assert. You can use this macro even when  Allegro  has  not  been  ini‐
21       tialised. Example:
22
23          #define DEBUGMODE
24          #include
25          ...
26          void my_blitter(BITMAP *source, int flags)
27          {
28             int some_variables;
29             ASSERT(source != NULL);
30             ASSERT(flags & GAME_RUNNING);
31             ...
32          }
33
34

SEE ALSO

36       al_assert(3), TRACE(3), register_assert_handler(3), expackf(3)
37
38
39
40Allegro                          version 4.2.2                       ASSERT(3)
Impressum