1 | /* Pango |
2 | * pango-trace-private.h: |
3 | * |
4 | * Copyright (C) 2020 Red Hat, Inc |
5 | * |
6 | * This library is free software; you can redistribute it and/or |
7 | * modify it under the terms of the GNU Lesser General Public |
8 | * License as published by the Free Software Foundation; either |
9 | * version 2 of the License, or (at your option) any later version. |
10 | * |
11 | * This library is distributed in the hope that it will be useful, |
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
14 | * Library General Public License for more details. |
15 | * |
16 | * You should have received a copy of the GNU Lesser General Public |
17 | * License along with this library. If not, see <http://www.gnu.org/licenses/>. |
18 | */ |
19 | |
20 | #pragma once |
21 | |
22 | |
23 | #ifdef HAVE_SYSPROF |
24 | #include <sysprof-capture.h> |
25 | #endif |
26 | |
27 | #include <glib.h> |
28 | |
29 | G_BEGIN_DECLS |
30 | |
31 | #ifdef HAVE_SYSPROF |
32 | #define PANGO_TRACE_CURRENT_TIME SYSPROF_CAPTURE_CURRENT_TIME |
33 | #else |
34 | #define PANGO_TRACE_CURRENT_TIME 0 |
35 | #endif |
36 | |
37 | void pango_trace_mark (gint64 begin_time, |
38 | const gchar *name, |
39 | const gchar *message_format, |
40 | ...) G_GNUC_PRINTF (3, 4); |
41 | |
42 | #ifndef HAVE_SYSPROF |
43 | /* Optimise the whole call out */ |
44 | #if defined(G_HAVE_ISO_VARARGS) |
45 | #define pango_trace_mark(b, n, m, ...) G_STMT_START { } G_STMT_END |
46 | #elif defined(G_HAVE_GNUC_VARARGS) |
47 | #define pango_trace_mark(b, n, m...) G_STMT_START { } G_STMT_END |
48 | #else |
49 | /* no varargs macro support; the call will have to be optimised out by the compiler */ |
50 | #endif |
51 | #endif |
52 | |
53 | G_END_DECLS |
54 | |