/[gentoo-projects]/portage-utils/porting.h
Gentoo

Contents of /portage-utils/porting.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download) (as text)
Sun Feb 16 21:14:24 2014 UTC (7 months, 1 week ago) by vapier
Branch: MAIN
Changes since 1.1: +4 -1 lines
File MIME type: text/x-chdr
start using O_PATH

1 /*
2 * Copyright 2005-2013 Gentoo Foundation
3 * Distributed under the terms of the GNU General Public License v2
4 * $Header: /var/cvsroot/gentoo-projects/portage-utils/porting.h,v 1.1 2013/09/29 22:42:36 vapier Exp $
5 *
6 * Copyright 2005-2008 Ned Ludd - <solar@gentoo.org>
7 * Copyright 2005-2013 Mike Frysinger - <vapier@gentoo.org>
8 *
9 * All the junk in one trunk!
10 */
11
12 #ifndef _PORTING_H
13 #define _PORTING_H
14
15 #ifdef HAVE_CONFIG_H
16 # include "config.h" /* make sure we have EPREFIX, if set */
17 #endif
18
19 #ifndef _GNU_SOURCE
20 #define _GNU_SOURCE
21 #endif
22 #ifndef _FILE_OFFSET_BITS
23 #define _FILE_OFFSET_BITS 64 /* #471024 */
24 #endif
25 #ifdef _AIX
26 #define _LINUX_SOURCE_COMPAT
27 #endif
28
29 #include <assert.h>
30 #include <ctype.h>
31 #include <dirent.h>
32 #include <errno.h>
33 #include <getopt.h>
34 #ifndef __INTERIX
35 #include <inttypes.h>
36 #endif
37 #include <libgen.h>
38 #include <limits.h>
39 #include <regex.h>
40 #include <stdarg.h>
41 #include <stdbool.h>
42 #include <stdio.h>
43 #include <stdlib.h>
44 #include <string.h>
45 #include <time.h>
46 #include <unistd.h>
47
48 #include <sys/stat.h>
49 #include <sys/time.h>
50 #include <sys/types.h>
51
52 #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof(*(arr)))
53
54 #ifndef BUFSIZE
55 # define BUFSIZE 8192
56 #endif
57
58 #ifndef MIN
59 #define MIN(x, y) ((x) < (y) ? (x) : (y))
60 #endif
61 #ifndef MAX
62 #define MAX(x, y) ((x) < (y) ? (y) : (x))
63 #endif
64
65 /* Easy enough to glue to older versions */
66 #ifndef O_CLOEXEC
67 #define O_CLOEXEC 0
68 #endif
69 #ifndef O_PATH
70 #define O_PATH 0
71 #endif
72
73 #ifndef CONFIG_EPREFIX
74 #define CONFIG_EPREFIX "/"
75 #endif
76
77 #endif

  ViewVC Help
Powered by ViewVC 1.1.20