File: error.h

package info (click to toggle)
smilutils 0.3.0-10
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 3,008 kB
  • ctags: 2,647
  • sloc: cpp: 13,066; sh: 8,861; ansic: 8,309; makefile: 294
file content (51 lines) | stat: -rw-r--r-- 1,755 bytes parent folder | download | duplicates (4)
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
/*
 * error.h Error handling
 * Copyright (C) 2000 Arne Schirmacher <arne@schirmacher.de>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software Foundation,
 * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 */

#ifndef _ERROR_H
#define _ERROR_H 1

#ifdef __cplusplus
extern "C"
{
#endif

/*
 * Should check for gcc/g++ and version > 2.6 I suppose
 */
#ifndef        __ASSERT_FUNCTION
#   define __ASSERT_FUNCTION   __PRETTY_FUNCTION__
#endif

#define fail_neg(eval)  real_fail_neg  (eval, #eval, __ASSERT_FUNCTION, __FILE__, __LINE__)
#define fail_null(eval) real_fail_null (eval, #eval, __ASSERT_FUNCTION, __FILE__, __LINE__)
#define fail_if(eval)   real_fail_if   (eval, #eval, __ASSERT_FUNCTION, __FILE__, __LINE__)

    void real_fail_neg  (int   eval,       const char *eval_str, const char *func, const char *file, int line);
    void real_fail_null (const void* eval, const char *eval_str, const char *func, const char *file, int line);
    void real_fail_if   (bool  eval,       const char *eval_str, const char *func, const char *file, int line);

	extern void sigpipe_clear( );
	extern int sigpipe_get( );

#ifdef __cplusplus
}
#endif

#endif