stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Sebor <se...@roguewave.com>
Subject Re: svn commit: r577000 - in /incubator/stdcxx/trunk: include/loc/_messages.h src/messages.cpp
Date Tue, 18 Sep 2007 19:24:12 GMT
faridz@apache.org wrote:
> Author: faridz
> Date: Tue Sep 18 10:56:44 2007
> New Revision: 577000

I'm curious about this change...

I thought dllexport was only necessary with symbols (functions
or objects) that could be referenced from user code (either
directly, or indirectly via our own inline functions), and that
references to our own symbols from with the stdcxx library itself,
even from other translation units, didn't need the decoration.

In this case, I note that __rw_cat_open() is being called from
a function that's declared inline (messages::do_open() in the
primary template), so at the first glance the change makes sense.
But then I also note that we're explicitly instantiating the
primary template on char and wchar_t (no other specializations
are allowed), which should prevent the do_open() member function
from being implicitly instantiated in code that uses it, and
that the dllexport shouldn't be necessary.

So, does this mean that I'm missing something or that something
isn't working quite the way it should? Could it be that MSVC is
actually inlining the virtual do_open()? (Most other compilers
don't inline virtual function so I would tend to define it out
of line to save the little bit of space and avoid code for it
from being emitted in every object file that calls it).

Martin

> 
> URL: http://svn.apache.org/viewvc?rev=577000&view=rev
> Log:
> 2007-09-18 Farid Zaripov <Farid_Zaripov@epam.com>
> 
> 	* _messages.h (__rw_cat_open): Declare fnuction as _RWSTD_EXPORT.
> 	* _messages.h (__rw_get_message): Ditto.
> 	* _messages.h (__rw_get_locale): Ditto.
> 	* _messages.h (__rw_cat_close): Ditto.
> 	* messages.cpp (__rw_cat_open): Ditto.
> 	* messages.cpp (__rw_get_message): Ditto.
> 	* messages.cpp (__rw_get_locale): Ditto.
> 	* messages.cpp (__rw_cat_close): Ditto.
> 
> Modified:
>     incubator/stdcxx/trunk/include/loc/_messages.h
>     incubator/stdcxx/trunk/src/messages.cpp
> 
> Modified: incubator/stdcxx/trunk/include/loc/_messages.h
> URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/include/loc/_messages.h?rev=577000&r1=576999&r2=577000&view=diff
> ==============================================================================
> --- incubator/stdcxx/trunk/include/loc/_messages.h (original)
> +++ incubator/stdcxx/trunk/include/loc/_messages.h Tue Sep 18 10:56:44 2007
> @@ -49,13 +49,17 @@
>  
>  _RWSTD_NAMESPACE (__rw) {
>  
> -int __rw_cat_open (const _STD::string&, const _V3_LOCALE::locale&);
> +_RWSTD_EXPORT int
> +__rw_cat_open (const _STD::string&, const _V3_LOCALE::locale&);
>  
> -const char* __rw_get_message (int, int, int);
> +_RWSTD_EXPORT const char*
> +__rw_get_message (int, int, int);
>  
> -const _V3_LOCALE::locale& __rw_get_locale (int);
> +_RWSTD_EXPORT const _V3_LOCALE::locale&
> +__rw_get_locale (int);
>  
> -void __rw_cat_close (int);
> +_RWSTD_EXPORT void
> +__rw_cat_close (int);
>  
>  }   // namespace __rw
>  
> 
> Modified: incubator/stdcxx/trunk/src/messages.cpp
> URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/src/messages.cpp?rev=577000&r1=576999&r2=577000&view=diff
> ==============================================================================
> --- incubator/stdcxx/trunk/src/messages.cpp (original)
> +++ incubator/stdcxx/trunk/src/messages.cpp Tue Sep 18 10:56:44 2007
> @@ -210,7 +210,7 @@
>  
>  // Open a message catalog and assign and return a handle for it.
>  
> -int
> +_RWSTD_EXPORT int
>  __rw_cat_open (const _STD::string &cat_name, const _STD::locale &loc)
>  {
>      _RWSTD_MT_CLASS_GUARD (__rw_open_cat_data);
> @@ -233,7 +233,7 @@
>  
>  
>  // Get message text from catalog.
> -const char*
> +_RWSTD_EXPORT const char*
>  __rw_get_message (int cat, int set_num, int msg_num)
>  {
>      if (cat < 0)
> @@ -261,7 +261,7 @@
>  
>  
>  // Get locale to be used for character translation for this message catalog.
> -const _STD::locale&
> +_RWSTD_EXPORT const _STD::locale&
>  __rw_get_locale (int cat)
>  {
>      _RWSTD_MT_CLASS_GUARD (__rw_open_cat_data);
> @@ -276,7 +276,7 @@
>  
>  
>  // Close a catalog and release its handle.
> -void
> +_RWSTD_EXPORT void
>  __rw_cat_close (int cat)
>  {
>      _RWSTD_MT_CLASS_GUARD (__rw_open_cat_data);
> 
> 


Mime
View raw message