aboutsummaryrefslogtreecommitdiffstats
path: root/internal.h
blob: db33be9a4c74d4878926fa8ee3f7406e11935320 (plain) (blame)
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
/* See LICENSE file for copyright and license details. */
#include "liberror.h"

#include <alloca.h>
#include <errno.h>
#include <inttypes.h>
#include <limits.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>


#if defined(__GNUC__)
# define GCC_ATTRIBUTES(...) __attribute__((__VA_ARGS__))
#else
# define GCC_ATTRIBUTES(...)
#endif

#define HIDDEN GCC_ATTRIBUTES(__visibility__("hidden"))
#define WEAK   GCC_ATTRIBUTES(__weak__)


struct liberror_backtrace {
	size_t refcount;
	size_t n;
	uintptr_t rips[];
};


HIDDEN extern _Thread_local struct liberror_error liberror_error_;
HIDDEN extern _Thread_local int liberror_have_error_;
extern _Thread_local struct liberror_backtrace *liberror_saved_backtrace;