Boost logo

Boost :

Subject: Re: [boost] bcp update #2: namespace renaming
From: John Maddock (john_at_[hidden])
Date: 2010-01-01 12:05:49


> Indeed this is a problem, but I also remember that not only namespace are
> relevant.
>
> In some older versions of boost I remember (I think in boot_thread 1.35)
> some function had names like:
>
> extern "C" boost_thread_some_callback_functions
>
> Were used, also, if at some point shared object/dll dynamic loading
> would be added they may use resolveable points like
>
> extern "C" boost_foobar_resolvable_sybol.
>
> My be added, outside boost namespace in order be loaded with
> dlsym/GetProcAddress.
>
> I suggest different approach I used in my namespace renaming
> script:
>
> http://art-blog.no-ip.info/files/rename.py
>
> I had taken each tocken and substituted boost -> newnamespace and
> BOOST -> NEWNAMESPACE
>
> Also I required rename directories as well.
> This approach is free from the above error that could happen.
>
> If some symbol would be missed it may cause symbol collapse and
> some wired bugs when using 2 versions boost in same program,
> shared object.

Indeed, however your script would still miss (all?) of the extern "C"
callbacks in current Trunk.

So far I've found:

asio_detail_posix_thread_function
lw_thread_routine
free_static_mutex
execution_monitor_jumping_signal_handler
execution_monitor_attaching_signal_handler
at_thread_exit
on_process_exit
on_process_enter
on_thread_enter
on_thread_exit

Plus all of the TR1 math functions (which should definitely not be renamed
IMO).

Unfortunately I don't see any way of renaming these automatically without
also clobbering all the system API's which get declared here and there.

Obviously these could be renamed as special cases easily enough... but
maintaining a manual list of API's to rename is a maintainance nightmare.

Any better ideas?

John.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk