~ubuntu-branches/ubuntu/maverick/grafx2/maverick

« back to all changes in this revision

Viewing changes to src/errors.h

  • Committer: Bazaar Package Importer
  • Author(s): Gürkan Sengün
  • Date: 2010-03-22 12:07:47 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20100322120747-g0jel6vf6mjkc53s
Tags: 2.2-1
* New upstream version, fixes FTBFS with binutils-gold. (Closes: #554742)
* Bump standards version to 3.8.4.
* debian/control: Add liblua5.1-0-dev and pkg-config to build depends.
* debian/rules: Drop dh_desktop call.
* debian/copyright: Update years.
* Switch to dpkg-source format version 3.0 (quilt).
* debian/watch: Added.
* Added patch to fix spelling errors in source code.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* vim:expandtab:ts=2 sw=2:
 
2
*/
 
3
/*  Grafx2 - The Ultimate 256-color bitmap paint program
 
4
 
 
5
    Copyright 2008 Adrien Destugues
 
6
 
 
7
    Grafx2 is free software; you can redistribute it and/or
 
8
    modify it under the terms of the GNU General Public License
 
9
    as published by the Free Software Foundation; version 2
 
10
    of the License.
 
11
 
 
12
    Grafx2 is distributed in the hope that it will be useful,
 
13
    but WITHOUT ANY WARRANTY; without even the implied warranty of
 
14
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
15
    GNU General Public License for more details.
 
16
 
 
17
    You should have received a copy of the GNU General Public License
 
18
    along with Grafx2; if not, see <http://www.gnu.org/licenses/>
 
19
*/
 
20
 
 
21
//////////////////////////////////////////////////////////////////////////////
 
22
///@file errors.h
 
23
/// Functions and macros for tracing and error reporting.
 
24
//////////////////////////////////////////////////////////////////////////////
 
25
 
 
26
#ifdef __VBCC__
 
27
    #define __func__ "stupid compiler !"
 
28
#endif
 
29
 
 
30
/// Prints the source filename, line number, function name, a string and an integer.
 
31
#define DEBUG(y,z) printf("%s %d %s | %s : %d###\n",__FILE__,__LINE__,__func__,y,(unsigned int)z)
 
32
 
 
33
/// Same as ::DEBUG but in hexadecimal
 
34
#define DEBUGX(y,z) printf("%s %d %s | %s : %X###\n",__FILE__,__LINE__,__func__,y,(unsigned int)z)
 
35
 
 
36
/// Helper function used by the macro ::Error
 
37
void Error_function(int error_code, const char *filename, int line_number, const char *function_name);
 
38
 
 
39
///
 
40
/// Report a run-time error: It will print to standard output some information
 
41
/// about the calling function, and then:
 
42
/// - If the error code is 0, just do a red screen flash and resume.
 
43
/// - If the error code is non-zero, abort the program.
 
44
#define Error(n) Error_function(n, __FILE__,__LINE__,__func__)
 
45
 
 
46
/// Helper function used by the macro ::Warning
 
47
void Warning_function(const char *message, const char *filename, int line_number, const char *function_name);
 
48
 
 
49
///
 
50
/// Report a run-time abnormal condition : It will print to standard output
 
51
/// some information about the calling function, and then resume silently.
 
52
/// This is most useful in debugger so you can put a breakpoint on
 
53
/// ::Warning_function and examine the stack trace.
 
54
#define Warning(msg) Warning_function(msg, __FILE__,__LINE__,__func__)