/[hurd]/hurd-l4/libc-parts/assert.h
ViewVC logotype

Diff of /hurd-l4/libc-parts/assert.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.5 by marcus, Mon Oct 25 13:50:10 2004 UTC revision 1.6 by neal, Wed Jan 12 10:33:39 2005 UTC
# Line 1  Line 1 
1  /* assert.h - Dummy assert declaration for libc-pars.  /* assert.h - Assert declaration for libc-parts.
2     Copyright (C) 2003 Free Software Foundation, Inc.     Copyright (C) 2003, 2005 Free Software Foundation, Inc.
3     Written by Johan Rydberg.     Written by Neal H. Walfield <neal@gnu.org>.
4    
5     This file is part of the GNU Hurd.     This file is part of the GNU Hurd.
6    
# Line 22  Line 22 
22  #ifndef _ASSERT_H  #ifndef _ASSERT_H
23  #define _ASSERT_H 1  #define _ASSERT_H 1
24    
25  /* Asserts aren't supported at the moment.  */  int printf (const char *fmt, ...);
26  #ifndef assert  
27  #define assert(expr)    do { } while (0)  #ifndef NDEBUG
28    #define assert(expr)                                    \
29            do {                                            \
30              if (! (expr))                                 \
31                {                                           \
32                  printf ("%s:%s:%d: Assert failed!\n",     \
33                          __FILE__, __func__, __LINE__);    \
34                  for (;;);                                 \
35                }                                           \
36            } while (0)
37    #else
38    #define assert(expr) do { } while (0)
39  #endif  #endif
40  #define assert_perror(err) assert(err == 0)  #define assert_perror(err) assert(err == 0)
41    
42  #endif /* assert.h */  #endif /* _ASSERT_H */

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.6

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26