Merging upstream version 0.7.0 (Closes: #493243, #510888, #567617, #699414, #709777...
[debian/lxpanel.git] / src / dbg.c
CommitLineData
6cc5e1a6
DB
1/**
2 * Copyright (c) 2006 LxDE Developers, see the file AUTHORS for details.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software Foundation,
16 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17 */
18
19#include "dbg.h"
20
00916e98 21#include <glib.h>
0f7f2ef3
AL
22
23void _check_cairo_status(cairo_t* cr, char const* file, char const* func, int line)
24{
25 cairo_status_t status = cairo_status(cr);
26 if (status != CAIRO_STATUS_SUCCESS)
00916e98 27 g_critical("%s:%s:%-5d: cairo had error %d: %s", file, func, line, status,
0f7f2ef3
AL
28 cairo_status_to_string(status));
29}
30
31void _check_cairo_surface_status(cairo_surface_t** surf, char const* file, char const* func, int line)
32{
33 cairo_status_t status = cairo_surface_status(*surf);
34 if (status != CAIRO_STATUS_SUCCESS) {
00916e98 35 g_critical("%s:%s:%-5d: cairo had error %d: %s", file, func, line, status,
0f7f2ef3
AL
36 cairo_status_to_string(status));
37 cairo_surface_destroy(*surf);
38 *surf = NULL;
39 }
40}
41
42/* vim: set sw=4 et sts=4 : */