OSDN Git Service

* c-common.c (decl_attributes): Differentiate between
[pf3gnuchains/gcc-fork.git] / libstdc++-v3 / mkcshadow
1 #!/usr/bin/env bash
2
3 # mkcshadow: reads header names (like "features.h" or "sys/types.h")
4 #   from stdin, and creates shadow headers under cshadow/, except where
5 #   a header of the same name is already in shadow/.
6
7 SCRIPTDIR=${0%/*}
8
9 if [ ! -d cshadow ]; then
10   echo "Creating cshadow."
11   mkdir ../cshadow
12 fi
13
14 echo "Creating..."
15 while read header; do
16
17   if [ ! -f $SCRIPTDIR/shadow/$header ]; then
18
19     # strip off directory names while making 
20     #   any necessary directories
21
22     dir=../cshadow
23     case "$header" in */*)
24       right="$header"
25       while [ "$right" != "${right##*/}" ] ; do
26         dir="$dir/${right%%/*}"
27         if [ ! -d "$dir" ]; then mkdir "$dir"; fi
28         right="${right#*/}"
29       done
30       ;;
31     esac
32
33     echo "  ../cshadow/$header"
34     UPNAME=`echo $header | tr 'a-z./-' 'A-Z___'`
35     cat >"../cshadow/$header" <<EOF
36 // -*- C++ -*- header wrapper.
37
38 // Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
39 //
40 // This file is part of the GNU ISO C++ Library.  This library is free
41 // software; you can redistribute it and/or modify it under the
42 // terms of the GNU General Public License as published by the
43 // Free Software Foundation; either version 2, or (at your option)
44 // any later version.
45
46 // This library is distributed in the hope that it will be useful,
47 // but WITHOUT ANY WARRANTY; without even the implied warranty of
48 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
49 // GNU General Public License for more details.
50
51 // You should have received a copy of the GNU General Public License along
52 // with this library; see the file COPYING.  If not, write to the Free
53 // Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
54 // USA.
55
56 // As a special exception, you may use this file as part of a free software
57 // library without restriction.  Specifically, if other files instantiate
58 // templates or use macros or inline functions from this file, or you compile
59 // this file and link it with other files to produce an executable, this
60 // file does not by itself cause the resulting executable to be covered by
61 // the GNU General Public License.  This exception does not however
62 // invalidate any other reasons why the executable file might be covered by
63 // the GNU General Public License.
64
65 // Note: this file was automatically generated by the "mkcshadow"
66 //       script.  RTFM!
67
68 #ifndef  _INCLUDED_CPP_${UPNAME}_
69
70 # ifdef _IN_C_LEGACY_  /* sub-included by a C header */
71 #   include_next <${header}>
72 # else
73
74     namespace _C_legacy { namespace _C_shadow { } }
75     using namespace ::_C_legacy::_C_shadow;
76     namespace _C_legacy {
77       extern "C" {
78 #       define _IN_C_LEGACY_
79 #       include_next <${header}>
80       } // close extern "C"
81     }   // close namespace _C_legacy::
82   
83 # endif /* _IN_C_LEGACY_ */
84 #endif /* _INCLUDED_CPP_${UPNAME}_ */
85 EOF
86 #################### end ####################
87   fi
88 done
89
90
91
92
93
94