Mercurial > hg > octave-shane > gnulib-hg
annotate lib/sys_ioctl.in.h @ 13055:c7be8484e434
maint: use pragma consistently across replacement headers
Several headers set #pragma GCC system_header prior to checking
any multiple inclusion guards; maintenance is easiest if all
replacement headers follow the same paradigm.
* lib/ctype.in.h (system_header): Hoist for consistent placement.
* lib/dirent.in.h (system_header): Likewise.
* lib/errno.in.h (system_header): Likewise.
* lib/float.in.h (system_header): Likewise.
* lib/getopt.in.h (system_header): Likewise.
* lib/iconv.in.h (system_header): Likewise.
* lib/inttypes.in.h (system_header): Likewise.
* lib/langinfo.in.h (system_header): Likewise.
* lib/locale.in.h (system_header): Likewise.
* lib/math.in.h (system_header): Likewise.
* lib/netdb.in.h (system_header): Likewise.
* lib/netinet_in.in.h (system_header): Likewise.
* lib/pty.in.h (system_header): Likewise.
* lib/sched.in.h (system_header): Likewise.
* lib/se-selinux.in.h (system_header): Likewise.
* lib/search.in.h (system_header): Likewise.
* lib/spawn.in.h (system_header): Likewise.
* lib/stdarg.in.h (system_header): Likewise.
* lib/stdint.in.h (system_header): Likewise.
* lib/string.in.h (system_header): Likewise.
* lib/strings.in.h (system_header): Likewise.
* lib/sys_file.in.h (system_header): Likewise.
* lib/sys_ioctl.in.h (system_header): Likewise.
* lib/sys_socket.in.h (system_header): Likewise.
* lib/sys_times.in.h (system_header): Likewise.
* lib/sys_utsname.in.h (system_header): Likewise.
* lib/sys_wait.in.h (system_header): Likewise.
* lib/sysexits.in.h (system_header): Likewise.
* lib/unistd.in.h (system_header): Likewise.
* lib/wctype.in.h (system_header): Likewise.
Signed-off-by: Eric Blake <eblake@redhat.com>
author | Eric Blake <eblake@redhat.com> |
---|---|
date | Thu, 25 Mar 2010 16:28:02 -0600 |
parents | 2c1c5f9d6a39 |
children | 527b353781be |
rev | line source |
---|---|
10615 | 1 /* Substitute for and wrapper around <sys/ioctl.h>. |
12559
c2cbabec01dd
update nearly all FSF copyright year lists to include 2010
Jim Meyering <meyering@redhat.com>
parents:
12497
diff
changeset
|
2 Copyright (C) 2008-2010 Free Software Foundation, Inc. |
10615 | 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 | |
10655
8668b19a7032
Avoid gcc warnings because of #pragma GCC system_header on older gcc.
Bruno Haible <bruno@clisp.org>
parents:
10615
diff
changeset
|
18 #if __GNUC__ >= 3 |
10615 | 19 @PRAGMA_SYSTEM_HEADER@ |
10655
8668b19a7032
Avoid gcc warnings because of #pragma GCC system_header on older gcc.
Bruno Haible <bruno@clisp.org>
parents:
10615
diff
changeset
|
20 #endif |
10615 | 21 |
13055
c7be8484e434
maint: use pragma consistently across replacement headers
Eric Blake <eblake@redhat.com>
parents:
12943
diff
changeset
|
22 #ifndef _GL_SYS_IOCTL_H |
c7be8484e434
maint: use pragma consistently across replacement headers
Eric Blake <eblake@redhat.com>
parents:
12943
diff
changeset
|
23 |
10615 | 24 /* The include_next requires a split double-inclusion guard. */ |
25 #if @HAVE_SYS_IOCTL_H@ | |
26 # @INCLUDE_NEXT@ @NEXT_SYS_IOCTL_H@ | |
27 #endif | |
28 | |
29 #ifndef _GL_SYS_IOCTL_H | |
30 #define _GL_SYS_IOCTL_H | |
31 | |
32 /* AIX 5.1 and Solaris 10 declare ioctl() in <unistd.h> and in <stropts.h>, | |
12497
e2d59f164e76
Avoid future namespace pollution on glibc systems.
Bruno Haible <bruno@clisp.org>
parents:
12451
diff
changeset
|
33 but not in <sys/ioctl.h>. |
e2d59f164e76
Avoid future namespace pollution on glibc systems.
Bruno Haible <bruno@clisp.org>
parents:
12451
diff
changeset
|
34 But avoid namespace pollution on glibc systems. */ |
e2d59f164e76
Avoid future namespace pollution on glibc systems.
Bruno Haible <bruno@clisp.org>
parents:
12451
diff
changeset
|
35 #ifndef __GLIBC__ |
e2d59f164e76
Avoid future namespace pollution on glibc systems.
Bruno Haible <bruno@clisp.org>
parents:
12451
diff
changeset
|
36 # include <unistd.h> |
e2d59f164e76
Avoid future namespace pollution on glibc systems.
Bruno Haible <bruno@clisp.org>
parents:
12451
diff
changeset
|
37 #endif |
10615 | 38 |
12943
2c1c5f9d6a39
sys_ioctl: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
39 /* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */ |
2c1c5f9d6a39
sys_ioctl: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
40 |
12766
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
41 /* The definition of _GL_WARN_ON_USE is copied here. */ |
10615 | 42 |
43 | |
44 /* Declare overridden functions. */ | |
45 | |
46 #if @GNULIB_IOCTL@ | |
47 # if @SYS_IOCTL_H_HAVE_WINSOCK2_H@ | |
12943
2c1c5f9d6a39
sys_ioctl: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
48 # if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
2c1c5f9d6a39
sys_ioctl: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
49 # undef ioctl |
2c1c5f9d6a39
sys_ioctl: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
50 # define ioctl rpl_ioctl |
2c1c5f9d6a39
sys_ioctl: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
51 # endif |
2c1c5f9d6a39
sys_ioctl: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
52 _GL_FUNCDECL_SYS (ioctl, int, |
2c1c5f9d6a39
sys_ioctl: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
53 (int fd, int request, ... /* {void *,char *} arg */)); |
10615 | 54 # endif |
12943
2c1c5f9d6a39
sys_ioctl: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
55 /* Need to cast, because on glibc systems, the second parameter is |
2c1c5f9d6a39
sys_ioctl: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
56 unsigned long int request. */ |
2c1c5f9d6a39
sys_ioctl: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
57 _GL_CXXALIAS_SYS_CAST (ioctl, int, |
2c1c5f9d6a39
sys_ioctl: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
58 (int fd, int request, ... /* {void *,char *} arg */)); |
2c1c5f9d6a39
sys_ioctl: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12766
diff
changeset
|
59 _GL_CXXALIASWARN (ioctl); |
11801
a29d6bab4448
Make it possible to use module 'gethostname' without module 'close' or 'ioctl'.
Bruno Haible <bruno@clisp.org>
parents:
10655
diff
changeset
|
60 #elif @SYS_IOCTL_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@ |
10615 | 61 # undef ioctl |
62 # define ioctl ioctl_used_without_requesting_gnulib_module_ioctl | |
63 #elif defined GNULIB_POSIXCHECK | |
64 # undef ioctl | |
12766
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
65 # if HAVE_RAW_DECL_IOCTL |
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
66 _GL_WARN_ON_USE (ioctl, "ioctl does not portably work on sockets - " |
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
67 "use gnulib module ioctl for portability"); |
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
68 # endif |
10615 | 69 #endif |
70 | |
71 | |
72 #endif /* _GL_SYS_IOCTL_H */ | |
73 #endif /* _GL_SYS_IOCTL_H */ |