Mercurial > hg > octave-lojdl > gnulib-hg
annotate lib/sys_utsname.in.h @ 16229:daac1ca4c436
inttypes: Modernize.
* lib/inttypes.in.h (strtoimax, strtoumax): Use the C++ safe idioms.
* modules/inttypes-incomplete (Depends-on): Add snippet/c++defs.
(Makefile.am): Update inttypes.h rule.
author | Bruno Haible <bruno@clisp.org> |
---|---|
date | Thu, 05 Jan 2012 18:42:08 +0100 |
parents | 8250f2777afc |
children | bb182ee4a09d |
rev | line source |
---|---|
11766 | 1 /* Substitute for <sys/utsname.h>. |
16201
8250f2777afc
maint: update all copyright year number ranges
Jim Meyering <meyering@redhat.com>
parents:
15489
diff
changeset
|
2 Copyright (C) 2009-2012 Free Software Foundation, Inc. |
11766 | 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 | |
14840
5f709022a256
Allow multiple gnulib generated include files to be combined.
Bruno Haible <bruno@clisp.org>
parents:
14274
diff
changeset
|
18 #ifndef _@GUARD_PREFIX@_SYS_UTSNAME_H |
13094
2ed0fc659db8
Emit #pragma system_header after the inclusion guard, not before.
Bruno Haible <bruno@clisp.org>
parents:
13055
diff
changeset
|
19 |
12533
57ab00b8ee20
sys_times, sys_utsname: use include_next
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
20 #if __GNUC__ >= 3 |
57ab00b8ee20
sys_times, sys_utsname: use include_next
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
21 @PRAGMA_SYSTEM_HEADER@ |
57ab00b8ee20
sys_times, sys_utsname: use include_next
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
22 #endif |
13761
a19ace3ba849
Avoid line length limitation from HP NonStop system header files.
Bruno Haible <bruno@clisp.org>
parents:
13094
diff
changeset
|
23 @PRAGMA_COLUMNS@ |
12533
57ab00b8ee20
sys_times, sys_utsname: use include_next
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
24 |
57ab00b8ee20
sys_times, sys_utsname: use include_next
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
25 #if @HAVE_SYS_UTSNAME_H@ |
15489
0377e22dd6c8
sys_utsname: Add support for Minix.
Bruno Haible <bruno@clisp.org>
parents:
14840
diff
changeset
|
26 |
0377e22dd6c8
sys_utsname: Add support for Minix.
Bruno Haible <bruno@clisp.org>
parents:
14840
diff
changeset
|
27 /* Minix 3.1.8 has a bug: <stddef.h> must be included before <sys/utsname.h>. |
0377e22dd6c8
sys_utsname: Add support for Minix.
Bruno Haible <bruno@clisp.org>
parents:
14840
diff
changeset
|
28 But avoid namespace pollution on glibc systems. */ |
0377e22dd6c8
sys_utsname: Add support for Minix.
Bruno Haible <bruno@clisp.org>
parents:
14840
diff
changeset
|
29 # if defined __minix && !defined __GLIBC__ |
0377e22dd6c8
sys_utsname: Add support for Minix.
Bruno Haible <bruno@clisp.org>
parents:
14840
diff
changeset
|
30 # include <stddef.h> |
0377e22dd6c8
sys_utsname: Add support for Minix.
Bruno Haible <bruno@clisp.org>
parents:
14840
diff
changeset
|
31 # endif |
0377e22dd6c8
sys_utsname: Add support for Minix.
Bruno Haible <bruno@clisp.org>
parents:
14840
diff
changeset
|
32 |
12533
57ab00b8ee20
sys_times, sys_utsname: use include_next
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
33 # @INCLUDE_NEXT@ @NEXT_SYS_UTSNAME_H@ |
15489
0377e22dd6c8
sys_utsname: Add support for Minix.
Bruno Haible <bruno@clisp.org>
parents:
14840
diff
changeset
|
34 |
12533
57ab00b8ee20
sys_times, sys_utsname: use include_next
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
35 #endif |
57ab00b8ee20
sys_times, sys_utsname: use include_next
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
36 |
14840
5f709022a256
Allow multiple gnulib generated include files to be combined.
Bruno Haible <bruno@clisp.org>
parents:
14274
diff
changeset
|
37 #define _@GUARD_PREFIX@_SYS_UTSNAME_H |
11766 | 38 |
12766
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
39 /* The definition of _GL_ARG_NONNULL is copied here. */ |
11766 | 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. */ |
12422
f7842310a565
New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents:
11766
diff
changeset
|
42 |
11766 | 43 |
44 #ifdef __cplusplus | |
45 extern "C" { | |
46 #endif | |
47 | |
12533
57ab00b8ee20
sys_times, sys_utsname: use include_next
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
48 #if !@HAVE_STRUCT_UTSNAME@ |
11766 | 49 /* Length of the entries in 'struct utsname' is 256. */ |
12533
57ab00b8ee20
sys_times, sys_utsname: use include_next
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
50 # define _UTSNAME_LENGTH 256 |
11766 | 51 |
12533
57ab00b8ee20
sys_times, sys_utsname: use include_next
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
52 # ifndef _UTSNAME_NODENAME_LENGTH |
57ab00b8ee20
sys_times, sys_utsname: use include_next
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
53 # define _UTSNAME_NODENAME_LENGTH _UTSNAME_LENGTH |
57ab00b8ee20
sys_times, sys_utsname: use include_next
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
54 # endif |
57ab00b8ee20
sys_times, sys_utsname: use include_next
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
55 # ifndef _UTSNAME_SYSNAME_LENGTH |
57ab00b8ee20
sys_times, sys_utsname: use include_next
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
56 # define _UTSNAME_SYSNAME_LENGTH _UTSNAME_LENGTH |
57ab00b8ee20
sys_times, sys_utsname: use include_next
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
57 # endif |
57ab00b8ee20
sys_times, sys_utsname: use include_next
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
58 # ifndef _UTSNAME_RELEASE_LENGTH |
57ab00b8ee20
sys_times, sys_utsname: use include_next
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
59 # define _UTSNAME_RELEASE_LENGTH _UTSNAME_LENGTH |
57ab00b8ee20
sys_times, sys_utsname: use include_next
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
60 # endif |
57ab00b8ee20
sys_times, sys_utsname: use include_next
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
61 # ifndef _UTSNAME_VERSION_LENGTH |
57ab00b8ee20
sys_times, sys_utsname: use include_next
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
62 # define _UTSNAME_VERSION_LENGTH _UTSNAME_LENGTH |
57ab00b8ee20
sys_times, sys_utsname: use include_next
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
63 # endif |
57ab00b8ee20
sys_times, sys_utsname: use include_next
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
64 # ifndef _UTSNAME_MACHINE_LENGTH |
57ab00b8ee20
sys_times, sys_utsname: use include_next
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
65 # define _UTSNAME_MACHINE_LENGTH _UTSNAME_LENGTH |
57ab00b8ee20
sys_times, sys_utsname: use include_next
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
66 # endif |
11766 | 67 |
14274
da5595160b9f
Allow multiple gnulib generated replacements to coexist.
Bruno Haible <bruno@clisp.org>
parents:
14079
diff
changeset
|
68 # if !GNULIB_defined_struct_utsname |
11766 | 69 /* Structure describing the system and machine. */ |
70 struct utsname | |
71 { | |
72 /* Name of this node on the network. */ | |
73 char nodename[_UTSNAME_NODENAME_LENGTH]; | |
74 | |
75 /* Name of the implementation of the operating system. */ | |
76 char sysname[_UTSNAME_SYSNAME_LENGTH]; | |
77 /* Current release level of this implementation. */ | |
78 char release[_UTSNAME_RELEASE_LENGTH]; | |
79 /* Current version level of this release. */ | |
80 char version[_UTSNAME_VERSION_LENGTH]; | |
81 | |
82 /* Name of the hardware type the system is running on. */ | |
83 char machine[_UTSNAME_MACHINE_LENGTH]; | |
84 }; | |
14274
da5595160b9f
Allow multiple gnulib generated replacements to coexist.
Bruno Haible <bruno@clisp.org>
parents:
14079
diff
changeset
|
85 # define GNULIB_defined_struct_utsname 1 |
da5595160b9f
Allow multiple gnulib generated replacements to coexist.
Bruno Haible <bruno@clisp.org>
parents:
14079
diff
changeset
|
86 # endif |
da5595160b9f
Allow multiple gnulib generated replacements to coexist.
Bruno Haible <bruno@clisp.org>
parents:
14079
diff
changeset
|
87 |
12533
57ab00b8ee20
sys_times, sys_utsname: use include_next
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
88 #endif /* !@HAVE_STRUCT_UTSNAME@ */ |
11766 | 89 |
90 | |
91 #if @GNULIB_UNAME@ | |
92 # if !@HAVE_UNAME@ | |
12422
f7842310a565
New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents:
11766
diff
changeset
|
93 extern int uname (struct utsname *buf) _GL_ARG_NONNULL ((1)); |
11766 | 94 # endif |
95 #elif defined GNULIB_POSIXCHECK | |
96 # undef uname | |
12766
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
97 # if HAVE_RAW_DECL_UNAME |
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
98 _GL_WARN_ON_USE (uname, "uname is unportable - " |
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
99 "use gnulib module uname for portability"); |
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
100 # endif |
11766 | 101 #endif |
102 | |
103 | |
104 #ifdef __cplusplus | |
105 } | |
106 #endif | |
107 | |
108 | |
14840
5f709022a256
Allow multiple gnulib generated include files to be combined.
Bruno Haible <bruno@clisp.org>
parents:
14274
diff
changeset
|
109 #endif /* _@GUARD_PREFIX@_SYS_UTSNAME_H */ |