]> git.ipfire.org Git - thirdparty/glibc.git/blame - scripts/check-c++-types.sh
Use <> for include of kernel-features.h.
[thirdparty/glibc.git] / scripts / check-c++-types.sh
CommitLineData
60336886 1#! /bin/bash
a53fa282 2# Copyright (C) 2003, 2005, 2006, 2007 Free Software Foundation, Inc.
60336886
UD
3# This file is part of the GNU C Library.
4
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.
9
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.
14
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.
19#
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 '^_' |
9b33781c 31# LC_ALL=C sort -u
60336886 32#
806e4a4a
UD
33data=$1
34shift
a53fa282 35cxx=$(echo $* | sed 's/-fgnu89-inline//')
60336886
UD
36while 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>
43void foo ($t) { }
44EOF
45) |
46 sed 's/[[:space:]]*[.]globa\?l[[:space:]]*_Z3foo\([_[:alnum:]]*\).*/\1/p;d'
47done <<EOF |
48blkcnt64_t
49blkcnt_t
50blksize_t
51caddr_t
52clockid_t
53clock_t
54daddr_t
55dev_t
56fd_mask
57fsblkcnt64_t
58fsblkcnt_t
59fsfilcnt64_t
60fsfilcnt_t
61fsid_t
62gid_t
63id_t
64ino64_t
65ino_t
66int16_t
67int32_t
68int64_t
69int8_t
70intptr_t
71key_t
72loff_t
73mode_t
74nlink_t
75off64_t
76off_t
77pid_t
ced368f7
UD
78pthread_attr_t
79pthread_barrier_t
80pthread_barrierattr_t
81pthread_cond_t
82pthread_condattr_t
60336886 83pthread_key_t
ced368f7
UD
84pthread_mutex_t
85pthread_mutexattr_t
60336886 86pthread_once_t
ced368f7
UD
87pthread_rwlock_t
88pthread_rwlockattr_t
60336886
UD
89pthread_spinlock_t
90pthread_t
91quad_t
92register_t
93rlim64_t
94rlim_t
95sigset_t
96size_t
97socklen_t
98ssize_t
99suseconds_t
60336886
UD
100time_t
101u_char
102uid_t
103uint
104u_int
105u_int16_t
106u_int32_t
107u_int64_t
108u_int8_t
109ulong
110u_long
111u_quad_t
112useconds_t
113ushort
114u_short
115EOF
116diff -N -U0 $data -