* sysdeps/mach/hurd/errno.c: New file.
[glibc.git] / scripts / check-c++-types.sh
blobf0ea0b5a842945d2b1602c9e992007df8aaafb18
1 #! /bin/bash
2 # Copyright (C) 2003, 2005 Free Software Foundation, Inc.
3 # This file is part of the GNU C Library.
5 # The GNU C Library is free software; you can redistribute it and/or
6 # modify it under the terms of the GNU Lesser General Public
7 # License as published by the Free Software Foundation; either
8 # version 2.1 of the License, or (at your option) any later version.
10 # The GNU C Library is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 # Lesser General Public License for more details.
15 # You should have received a copy of the GNU Lesser General Public
16 # License along with the GNU C Library; if not, write to the Free
17 # Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
18 # 02111-1307 USA.
20 # The list of data types has been created with
21 # cat <<EOF |
22 # #include <sys/types.h>
23 # #include <unistd.h>
24 # #include <sys/resource.h>
25 # #include <sys/stat.h>
26 # EOF
27 # gcc -D_GNU_SOURCE -E - |
28 # egrep '^typedef.*;$' |
29 # sed 's/^typedef[[:space:]]*//;s/\([[:space:]]\{1,\}__attribute__.*\);/;/;s/.*[[:space:]]\([*]\|\)\(.*\);/\2/' |
30 # egrep -v '^_' |
31 # LC_ALL=C sort -u
33 data=$1
34 shift
35 cxx="$*"
36 while read t; do
37 echo -n "$t:"
38 $cxx -S -xc++ -o - -D_GNU_SOURCE <(cat <<EOF
39 #include <sys/types.h>
40 #include <sys/stat.h>
41 #include <sys/resource.h>
42 #include <unistd.h>
43 void foo ($t) { }
44 EOF
45 ) |
46 sed 's/[[:space:]]*[.]globa\?l[[:space:]]*_Z3foo\([_[:alnum:]]*\).*/\1/p;d'
47 done <<EOF |
48 blkcnt64_t
49 blkcnt_t
50 blksize_t
51 caddr_t
52 clockid_t
53 clock_t
54 daddr_t
55 dev_t
56 fd_mask
57 fsblkcnt64_t
58 fsblkcnt_t
59 fsfilcnt64_t
60 fsfilcnt_t
61 fsid_t
62 gid_t
63 id_t
64 ino64_t
65 ino_t
66 int16_t
67 int32_t
68 int64_t
69 int8_t
70 intptr_t
71 key_t
72 loff_t
73 mode_t
74 nlink_t
75 off64_t
76 off_t
77 pid_t
78 pthread_key_t
79 pthread_once_t
80 pthread_spinlock_t
81 pthread_t
82 quad_t
83 register_t
84 rlim64_t
85 rlim_t
86 sigset_t
87 size_t
88 socklen_t
89 ssize_t
90 suseconds_t
91 time_t
92 u_char
93 uid_t
94 uint
95 u_int
96 u_int16_t
97 u_int32_t
98 u_int64_t
99 u_int8_t
100 ulong
101 u_long
102 u_quad_t
103 useconds_t
104 ushort
105 u_short
107 diff -N -U0 $data -