blob: 28b63174e45571a8f3c10c1f99b6ec7ec2217ed7 (
plain)
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
|
/*
* Copyright 2005-2014 Gentoo Foundation
* Distributed under the terms of the GNU General Public License v2
*
* Copyright 2005-2008 Ned Ludd - <solar@gentoo.org>
* Copyright 2005-2014 Mike Frysinger - <vapier@gentoo.org>
*
* All the junk in one trunk!
*/
#ifndef _PORTING_H
#define _PORTING_H
#ifdef HAVE_CONFIG_H
# include "config.h" /* make sure we have EPREFIX, if set */
#endif
#ifndef _GNU_SOURCE
#define _GNU_SOURCE
#endif
#ifndef _FILE_OFFSET_BITS
#define _FILE_OFFSET_BITS 64 /* #471024 */
#endif
#ifdef _AIX
#define _LINUX_SOURCE_COMPAT
#endif
#include <alloca.h>
#include <assert.h>
#include <ctype.h>
#include <dirent.h>
#include <errno.h>
#include <getopt.h>
#include <inttypes.h>
#include <libgen.h>
#include <limits.h>
#include <regex.h>
#include <stdarg.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <unistd.h>
#include <sys/stat.h>
#include <sys/time.h>
#include <sys/types.h>
#include <iniparser.h>
#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof(*(arr)))
#ifndef BUFSIZE
# define BUFSIZE 8192
#endif
#ifndef MIN
#define MIN(x, y) ((x) < (y) ? (x) : (y))
#endif
#ifndef MAX
#define MAX(x, y) ((x) < (y) ? (y) : (x))
#endif
/* Easy enough to glue to older versions */
#ifndef O_CLOEXEC
#define O_CLOEXEC 0
#endif
#ifndef O_PATH
#define O_PATH 0
#endif
#ifndef CONFIG_EPREFIX
#define CONFIG_EPREFIX "/"
#endif
#endif
|