Allow multiple gnulib generated include files to be combined.
[gnulib.git] / lib / sys_utsname.in.h
1 /* Substitute for <sys/utsname.h>.
2    Copyright (C) 2009-2011 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 _@GUARD_PREFIX@_SYS_UTSNAME_H
19
20 #if __GNUC__ >= 3
21 @PRAGMA_SYSTEM_HEADER@
22 #endif
23 @PRAGMA_COLUMNS@
24
25 #if @HAVE_SYS_UTSNAME_H@
26 # @INCLUDE_NEXT@ @NEXT_SYS_UTSNAME_H@
27 #endif
28
29 #define _@GUARD_PREFIX@_SYS_UTSNAME_H
30
31 /* The definition of _GL_ARG_NONNULL is copied here.  */
32
33 /* The definition of _GL_WARN_ON_USE is copied here.  */
34
35
36 #ifdef __cplusplus
37 extern "C" {
38 #endif
39
40 #if !@HAVE_STRUCT_UTSNAME@
41 /* Length of the entries in 'struct utsname' is 256.  */
42 # define _UTSNAME_LENGTH 256
43
44 # ifndef _UTSNAME_NODENAME_LENGTH
45 #  define _UTSNAME_NODENAME_LENGTH _UTSNAME_LENGTH
46 # endif
47 # ifndef _UTSNAME_SYSNAME_LENGTH
48 #  define _UTSNAME_SYSNAME_LENGTH _UTSNAME_LENGTH
49 # endif
50 # ifndef _UTSNAME_RELEASE_LENGTH
51 #  define _UTSNAME_RELEASE_LENGTH _UTSNAME_LENGTH
52 # endif
53 # ifndef _UTSNAME_VERSION_LENGTH
54 #  define _UTSNAME_VERSION_LENGTH _UTSNAME_LENGTH
55 # endif
56 # ifndef _UTSNAME_MACHINE_LENGTH
57 #  define _UTSNAME_MACHINE_LENGTH _UTSNAME_LENGTH
58 # endif
59
60 # if !GNULIB_defined_struct_utsname
61 /* Structure describing the system and machine.  */
62 struct utsname
63   {
64     /* Name of this node on the network.  */
65     char nodename[_UTSNAME_NODENAME_LENGTH];
66
67     /* Name of the implementation of the operating system.  */
68     char sysname[_UTSNAME_SYSNAME_LENGTH];
69     /* Current release level of this implementation.  */
70     char release[_UTSNAME_RELEASE_LENGTH];
71     /* Current version level of this release.  */
72     char version[_UTSNAME_VERSION_LENGTH];
73
74     /* Name of the hardware type the system is running on.  */
75     char machine[_UTSNAME_MACHINE_LENGTH];
76   };
77 #  define GNULIB_defined_struct_utsname 1
78 # endif
79
80 #endif /* !@HAVE_STRUCT_UTSNAME@ */
81
82
83 #if @GNULIB_UNAME@
84 # if !@HAVE_UNAME@
85 extern int uname (struct utsname *buf) _GL_ARG_NONNULL ((1));
86 # endif
87 #elif defined GNULIB_POSIXCHECK
88 # undef uname
89 # if HAVE_RAW_DECL_UNAME
90 _GL_WARN_ON_USE (uname, "uname is unportable - "
91                  "use gnulib module uname for portability");
92 # endif
93 #endif
94
95
96 #ifdef __cplusplus
97 }
98 #endif
99
100
101 #endif /* _@GUARD_PREFIX@_SYS_UTSNAME_H */