~ubuntu-branches/ubuntu/vivid/emscripten/vivid-proposed

« back to all changes in this revision

Viewing changes to system/include/libc/assert.h

  • Committer: Package Import Robot
  • Author(s): Sylvestre Ledru
  • Date: 2014-01-19 14:12:40 UTC
  • mfrom: (4.1.2 sid)
  • Revision ID: package-import@ubuntu.com-20140119141240-nfiw0p8033oitpfz
Tags: 1.9.0~20140119~7dc8c2f-1
* New snapshot release (Closes: #733714)
* Provide sources for javascript and flash. Done in orig-tar.sh
  Available in third_party/websockify/include/web-socket-js/src/
  (Closes: #735903)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
        assert.h
3
 
*/
4
 
 
5
 
#ifdef __cplusplus
6
 
extern "C" {
7
 
#endif
8
 
 
9
 
#include "_ansi.h"
 
1
#include <features.h>
10
2
 
11
3
#undef assert
12
4
 
13
 
#ifdef NDEBUG           /* required by ANSI standard */
14
 
# define assert(__e) ((void)0)
 
5
#ifdef NDEBUG
 
6
#define assert(x) (void)0
15
7
#else
16
 
# define assert(__e) ((__e) ? (void)0 : __assert_func (__FILE__, __LINE__, \
17
 
                                                       __ASSERT_FUNC, #__e))
18
 
 
19
 
# ifndef __ASSERT_FUNC
20
 
  /* Use g++'s demangled names in C++.  */
21
 
#  if defined __cplusplus && defined __GNUC__
22
 
#   define __ASSERT_FUNC __PRETTY_FUNCTION__
23
 
 
24
 
  /* C99 requires the use of __func__.  */
25
 
#  elif __STDC_VERSION__ >= 199901L
26
 
#   define __ASSERT_FUNC __func__
27
 
 
28
 
  /* Older versions of gcc don't have __func__ but can use __FUNCTION__.  */
29
 
#  elif __GNUC__ >= 2
30
 
#   define __ASSERT_FUNC __FUNCTION__
31
 
 
32
 
  /* failed to detect __func__ support.  */
33
 
#  else
34
 
#   define __ASSERT_FUNC ((char *) 0)
35
 
#  endif
36
 
# endif /* !__ASSERT_FUNC */
37
 
#endif /* !NDEBUG */
38
 
 
39
 
void _EXFUN(__assert, (const char *, int, const char *)
40
 
            _ATTRIBUTE(noreturn));
41
 
void _EXFUN(__assert_func, (const char *, int, const char *, const char *)
42
 
            _ATTRIBUTE(noreturn));
 
8
#define assert(x) ((void)((x) || (__assert_fail(#x, __FILE__, __LINE__, __func__),0)))
 
9
#endif
 
10
 
 
11
#ifdef __cplusplus
 
12
extern "C" {
 
13
#endif
 
14
 
 
15
_Noreturn void __assert_fail (const char *, const char *, int, const char *);
43
16
 
44
17
#ifdef __cplusplus
45
18
}