summaryrefslogtreecommitdiff
path: root/PACE/pace/assert.h
blob: 00c5dff11807e4c2533c56cfdb58631e29652c24 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/* $Id$ -*- C -*-

 * ============================================================================
 *
 * = LIBRARY
 *    pace
 *
 * = FILENAME
 *    pace/assert.h
 *
 * = AUTHOR
 *    Joe Hoffert
 *
 * =========================================================================== */

#ifndef PACE_ASSERT_H
#define PACE_ASSERT_H

#include "pace/config/defines.h"

#if (PACE_HAS_POSIX)
# include "pace/posix/assert.h"
#elif (PACE_VXWORKS)
# include "pace/vxworks/assert.h"
#elif (PACE_WIN32)
# include "pace/win32/assert.h"
#endif

#if defined (PACE_HAS_CPLUSPLUS)
extern "C" {
#endif /* PACE_HAS_CPLUSPLUS */

  /**
     PACE's implementation of the POSIX macro assert.
     See POSIX standard (Internation Standard ISO/IEC 9945-1:1996;
     IEEE Std 1003.1, 1996 Edition), Section 8.1.

     Use a macro because assert uses __FILE__ and __LINE__, which
     would not be useful with an inline function.
   */

#if (PACE_HAS_POSIX_MP_UOF)
#if defined (PACE_NDEBUG)
# define pace_assert(X)
#else  /* ! PACE_NDEBUG */
# define pace_assert(X) assert (X)
#endif /* ! PACE_NDEBUG */
#endif /* PACE_HAS_POSIX_MP_UOF */

#if defined (PACE_HAS_INLINE)
#  if (PACE_HAS_POSIX)
#    include "pace/posix/assert.inl"
#  elif (PACE_VXWORKS)
#    include "pace/vxworks/assert.inl"
#  elif (PACE_WIN32)
#    include "pace/win32/assert.inl"
#  endif
#endif /* PACE_HAS_INLINE */

# if defined (PACE_HAS_CPLUSPLUS)
}
# endif /* PACE_HAS_CPLUSPLUS */

#endif /* PACE_ASSERT_H */