Blame


1 9981e8e3 2023-01-19 thomas /*
2 9981e8e3 2023-01-19 thomas * Copyright (c) 2022 Omar Polo <op@openbsd.org>
3 9981e8e3 2023-01-19 thomas *
4 9981e8e3 2023-01-19 thomas * Permission to use, copy, modify, and distribute this software for any
5 9981e8e3 2023-01-19 thomas * purpose with or without fee is hereby granted, provided that the above
6 9981e8e3 2023-01-19 thomas * copyright notice and this permission notice appear in all copies.
7 9981e8e3 2023-01-19 thomas *
8 9981e8e3 2023-01-19 thomas * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 9981e8e3 2023-01-19 thomas * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 9981e8e3 2023-01-19 thomas * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 9981e8e3 2023-01-19 thomas * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 9981e8e3 2023-01-19 thomas * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13 9981e8e3 2023-01-19 thomas * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14 9981e8e3 2023-01-19 thomas * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15 9981e8e3 2023-01-19 thomas */
16 9981e8e3 2023-01-19 thomas
17 9981e8e3 2023-01-19 thomas #ifndef COMPAT_H
18 9981e8e3 2023-01-19 thomas #define COMPAT_H
19 9981e8e3 2023-01-19 thomas
20 9981e8e3 2023-01-19 thomas #ifndef __OpenBSD__
21 9981e8e3 2023-01-19 thomas #define pledge(s, p) (0)
22 9981e8e3 2023-01-19 thomas #define unveil(s, p) (0)
23 9981e8e3 2023-01-19 thomas #endif
24 9981e8e3 2023-01-19 thomas
25 9981e8e3 2023-01-19 thomas #ifndef __dead
26 9981e8e3 2023-01-19 thomas #define __dead __attribute__((__noreturn__))
27 9981e8e3 2023-01-19 thomas #endif
28 9981e8e3 2023-01-19 thomas
29 9981e8e3 2023-01-19 thomas #ifndef HAVE_ASPRINTF
30 9981e8e3 2023-01-19 thomas int asprintf(char **, const char *, ...);
31 9981e8e3 2023-01-19 thomas int vasprintf(char **, const char *, va_list);
32 9981e8e3 2023-01-19 thomas #endif
33 9981e8e3 2023-01-19 thomas
34 9981e8e3 2023-01-19 thomas #ifndef HAVE_ERR
35 9981e8e3 2023-01-19 thomas __dead void err(int, const char *, ...);
36 9981e8e3 2023-01-19 thomas __dead void errx(int, const char *, ...);
37 9981e8e3 2023-01-19 thomas void warn(const char *, ...);
38 9981e8e3 2023-01-19 thomas void warnx(const char *, ...);
39 9981e8e3 2023-01-19 thomas #else
40 9981e8e3 2023-01-19 thomas # include <err.h>
41 9981e8e3 2023-01-19 thomas #endif
42 9981e8e3 2023-01-19 thomas
43 9981e8e3 2023-01-19 thomas #ifndef HAVE_GETPROGNAME
44 9981e8e3 2023-01-19 thomas const char *getprogname(void);
45 9981e8e3 2023-01-19 thomas #endif
46 9981e8e3 2023-01-19 thomas
47 9981e8e3 2023-01-19 thomas #ifndef HAVE_REALLOCARRAY
48 9981e8e3 2023-01-19 thomas void *reallocarray(void *, size_t, size_t);
49 9981e8e3 2023-01-19 thomas #endif
50 9981e8e3 2023-01-19 thomas
51 9981e8e3 2023-01-19 thomas #endif