Merge branch 'vendor/GCC50'
[dragonfly.git] / contrib / grep / src / system.h
1 /* Portability cruft.  Include after config.h and sys/types.h.
2    Copyright 1996, 1998-2000, 2007, 2009-2014 Free Software Foundation, Inc.
3
4    This program is free software; you can redistribute it and/or modify
5    it under the terms of the GNU General Public License as published by
6    the Free Software Foundation; either version 3, or (at your option)
7    any later version.
8
9    This program is distributed in the hope that it will be useful,
10    but WITHOUT ANY WARRANTY; without even the implied warranty of
11    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12    GNU General Public License for more details.
13
14    You should have received a copy of the GNU General Public License
15    along with this program; if not, write to the Free Software
16    Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
17    02110-1301, USA.  */
18
19 #ifndef GREP_SYSTEM_H
20 #define GREP_SYSTEM_H 1
21
22 #include <fcntl.h>
23 #include <unistd.h>
24 #include <errno.h>
25
26 #include "binary-io.h"
27 #include "configmake.h"
28 #include "dirname.h"
29 #include "minmax.h"
30 #include "same-inode.h"
31
32 #include <stdlib.h>
33 #include <stddef.h>
34 #include <limits.h>
35 #include <string.h>
36 #include <ctype.h>
37
38 enum { EXIT_TROUBLE = 2 };
39
40 #include <gettext.h>
41 #define N_(String) gettext_noop(String)
42 #define _(String) gettext(String)
43
44 #include <locale.h>
45
46 #ifndef initialize_main
47 # define initialize_main(argcp, argvp)
48 #endif
49
50 #include "unlocked-io.h"
51
52 #define STREQ(a, b) (strcmp (a, b) == 0)
53
54 /* Convert a possibly-signed character to an unsigned character.  This is
55    a bit safer than casting to unsigned char, since it catches some type
56    errors that the cast doesn't.  */
57 static inline unsigned char
58 to_uchar (char ch)
59 {
60   return ch;
61 }
62
63 #endif