OSDN Git Service

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