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

« back to all changes in this revision

Viewing changes to 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
 
/*  Grafx2 - The Ultimate 256-color bitmap paint program
2
 
 
3
 
    Copyright 2008 Adrien Destugues
4
 
 
5
 
    Grafx2 is free software; you can redistribute it and/or
6
 
    modify it under the terms of the GNU General Public License
7
 
    as published by the Free Software Foundation; version 2
8
 
    of the License.
9
 
 
10
 
    Grafx2 is distributed in the hope that it will be useful,
11
 
    but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 
    GNU General Public License for more details.
14
 
 
15
 
    You should have received a copy of the GNU General Public License
16
 
    along with Grafx2; if not, see <http://www.gnu.org/licenses/>
17
 
*/
18
 
 
19
 
//////////////////////////////////////////////////////////////////////////////
20
 
///@file errors.h
21
 
/// Functions and macros for tracing and error reporting.
22
 
//////////////////////////////////////////////////////////////////////////////
23
 
 
24
 
/// Prints the source filename, line number, function name, a string and an integer.
25
 
#define DEBUG(y,z) printf("%s %d %s | %s : %d###\n",__FILE__,__LINE__,__func__,y,(unsigned int)z)
26
 
 
27
 
/// Same as ::DEBUG but in hexadecimal
28
 
#define DEBUGX(y,z) printf("%s %d %s | %s : %X###\n",__FILE__,__LINE__,__func__,y,(unsigned int)z)
29
 
 
30
 
/// Helper function used by the macro ::Error
31
 
void Error_function(int error_code, const char *filename, int line_number, const char *function_name);
32
 
 
33
 
///
34
 
/// Report a run-time error: It will print to standard output some information
35
 
/// about the calling function, and then:
36
 
/// - If the error code is 0, just do a red screen flash and resume.
37
 
/// - If the error code is non-zero, abort the program.
38
 
#define Error(n) Error_function(n, __FILE__,__LINE__,__func__)