forkpty, openpty: prefer glibc's const-safe prototype
[pspp] / lib / pty.in.h
1 /* Substitute for and wrapper around <pty.h>.
2    Copyright (C) 2010 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 2, 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 Foundation,
16    Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
17
18 #ifndef _GL_PTY_H
19
20 #if __GNUC__ >= 3
21 @PRAGMA_SYSTEM_HEADER@
22 #endif
23
24 /* The include_next requires a split double-inclusion guard.  */
25 #if @HAVE_PTY_H@
26 # @INCLUDE_NEXT@ @NEXT_PTY_H@
27 #endif
28
29 #ifndef _GL_PTY_H
30 #define _GL_PTY_H
31
32 /* Some platforms declare this in a different header than glibc.  */
33 #if @HAVE_UTIL_H@
34 # include <util.h>
35 #endif
36 #if @HAVE_LIBUTIL_H@
37 # include <libutil.h>
38 #endif
39
40 /* The definitions of _GL_FUNCDECL_RPL etc. are copied here.  */
41
42 /* The definition of _GL_WARN_ON_USE is copied here.  */
43
44
45 /* Declare overridden functions.  */
46
47 #if @GNULIB_FORKPTY@
48 # if @REPLACE_FORKPTY@
49 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
50 #   undef forkpty
51 #   define forkpty rpl_forkpty
52 #  endif
53 _GL_FUNCDECL_RPL (forkpty, int,
54                   (int *, char *, struct termios const *,
55                    struct winsize const *));
56 _GL_CXXALIAS_RPL (forkpty, int,
57                   (int *, char *, struct termios const *,
58                    struct winsize const *));
59 # else
60 _GL_CXXALIAS_SYS (forkpty, int,
61                   (int *, char *, struct termios const *,
62                    struct winsize const *));
63 # endif
64 _GL_CXXALIASWARN (forkpty);
65 #elif defined GNULIB_POSIXCHECK
66 # undef forkpty
67 # if HAVE_RAW_DECL_FORKPTY
68 _GL_WARN_ON_USE (forkpty, "forkpty is not declared consistently - "
69                  "use gnulib module forkpty for portability");
70 # endif
71 #endif
72
73 #if @GNULIB_OPENPTY@
74 # if @REPLACE_OPENPTY@
75 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
76 #   undef openpty
77 #   define openpty rpl_openpty
78 #  endif
79 _GL_FUNCDECL_RPL (openpty, int,
80                   (int *, int *, char *, struct termios const *,
81                    struct winsize const *));
82 _GL_CXXALIAS_RPL (openpty, int,
83                   (int *, int *, char *, struct termios const *,
84                    struct winsize const *));
85 # else
86 _GL_CXXALIAS_SYS (openpty, int,
87                   (int *, int *, char *, struct termios const *,
88                    struct winsize const *));
89 # endif
90 _GL_CXXALIASWARN (openpty);
91 #elif defined GNULIB_POSIXCHECK
92 # undef openpty
93 # if HAVE_RAW_DECL_OPENPTY
94 _GL_WARN_ON_USE (openpty, "openpty is not declared consistently - "
95                  "use gnulib module openpty for portability");
96 # endif
97 #endif
98
99
100 #endif /* _GL_PTY_H */
101 #endif /* _GL_PTY_H */