This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: automatic conversion to new libstdc++-v3


A Mennucc1 <debian@tonelli.sns.it> writes:

> hello
> 
> I have tried to prepare a tool that tries to automatically convert
> c++ code to use the new library libstdc++-v3, and then gcc-v3.0
> 
> This sh script tries to solve the problem shown in 
>  http://gcc.gnu.org/onlinedocs/libstdc++/17_intro/porting-howto.html
> as suggested in section 1.1.4

Well, someone just posted another solution on gnu.gcc.help which is probably
better:

Juergen Heinzl wrote:
>the rug only. To keep it "compatible" use std:: and for
>other compilers which may choke on it you can even use ...
>#if defined(COMPILER_XYZ_VERSION_012)
>#   define std
>#endif
>...

 
>  Usage: gcc-3.0-ize [ --undo ]
>   In libstdc++-v3 the string class has been moved to std::string, and
>   so for other classes.
>   gcc-3.0-ize tries to automatically adapt your source code; to this end,
>   gcc-3.0-ize patches the c++ code and the 'configure.in' file.
> 
>   gcc-3.0-ize adds AC_LIBSTDCXX_STRING to configure.in: 
>    this autoconf macro checks if 'string' is in base namespace or in 'std::'
>    and it defines NS_STD in config.h
>    and replaces NS_THESTD in *.in accordingly.
>   See gcc-3.0-ize.m4 for details.
> 
>   The header files FILE.h that will be installed by 'make install' are
>   changed to FILE.h.in so that they will be preprocessed accordingly
>   by 'configure'.
> 
>   All other c++ files are patched directly:
>   gcc-3.0-ize changes the c++ code to use the preprocessor variable NS_STD.
>   It also deletes 'bad_alloc' that is not a valid signal any more.
> 
>   Currently gcc-3.0-ize handles the following classes:
>    string basic_string deque queue list cout cin ios basic_streambuf streambuf stream
>   It is quite easy to add other classes. Please tell me which I am missing.
> 
>   gcc-3.0-ize backups any file into file.nogcc-3.0 so that
>   gcc-3.0-ize --undo   will safely undo any change to your project. 
> 
> to use, put both attachments in a same directory.

-- 
Felix Natter


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]