You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@stdcxx.apache.org by Farid Zaripov <Fa...@epam.com> on 2007/11/30 18:37:52 UTC

_RWSTD_LIB_SRC macro is not #defined in src/export.cpp

  I've found that _RWSTD_LIB_SRC macro is not #defined in src/export.cpp
file.

  This is a mistake, or it's required by design?

Farid.

Re: _RWSTD_LIB_SRC macro is not #defined in src/export.cpp

Posted by Martin Sebor <se...@roguewave.com>.

Farid Zaripov-2 wrote:
> 
> From: Martin Sebor [mailto:sebor@roguewave.com]
> To: stdcxx-dev@incubator.apache.org
> Subject: Re: _RWSTD_LIB_SRC macro is not #defined in src/export.cpp
> 
>> The _RWSTD_INSTANTIATE_TEMPLATES part is an implementation detail
>> of _RWSTD_LIB_SRC. If we were to add another detail like that we'd
>> have to also remember to update export.cpp. That seems just as
>> brittle as what we're doing now (i.e., not #defining _RWSTD_LIB_SRC).
> 
>> 
>>   The #define _RWSTD_LIB_SRC in every library src file is needed
>> for the implementing the autolinking feature on MSVC.
> 
>> I see. You're adding a #pragma comment to _config.h that expands
>> when _RWSTD_LIB_SRC is #defined and you need it to expand in all
>> library sources, correct?
>  
>   No. The #pragma comment directive should be expanded only in user's
> source files (actually it's enough to expand this directive in only one
> source file of the user's project, but we can't handle this).
>  
>   At the same time #pragma comment shouldn't expanded in library source
> files, elsewere the linker will search libstdxx.lib while linking the
> library
> itself and will fail with the error "libstdxx.lib not found".
> 
> 

Okay, I get it, thanks.


Farid Zaripov-2 wrote:
> 
>  
>   The negative effect of the using autolinking feature is the case when
> user
> uses the some part of the library, that fully implemented in header files
> and the user don't have to link its project with stdcxx library, but
> #pragma comment will force the linker to search and use the specified
> library.
> For that case there handled _RWSTD_NO_EXT_AUTOLINK macro.
> 
> Farid.
>  
> 
> 

I don't think we need to worry about this case. AFAIK, most of the time
the library is required.

Martin
-- 
View this message in context: http://www.nabble.com/_RWSTD_LIB_SRC-macro-is-not--defined-in-src-export.cpp-tp14094334p14248315.html
Sent from the stdcxx-dev mailing list archive at Nabble.com.


Re: _RWSTD_LIB_SRC macro is not #defined in src/export.cpp

Posted by Farid Zaripov <Fa...@epam.com>.
From: Martin Sebor [mailto:sebor@roguewave.com]
To: stdcxx-dev@incubator.apache.org
Subject: Re: _RWSTD_LIB_SRC macro is not #defined in src/export.cpp

> The _RWSTD_INSTANTIATE_TEMPLATES part is an implementation detail
> of _RWSTD_LIB_SRC. If we were to add another detail like that we'd
> have to also remember to update export.cpp. That seems just as
> brittle as what we're doing now (i.e., not #defining _RWSTD_LIB_SRC).

> 
>   The #define _RWSTD_LIB_SRC in every library src file is needed
> for the implementing the autolinking feature on MSVC.

> I see. You're adding a #pragma comment to _config.h that expands
> when _RWSTD_LIB_SRC is #defined and you need it to expand in all
> library sources, correct?
 
  No. The #pragma comment directive should be expanded only in user's
source files (actually it's enough to expand this directive in only one
source file of the user's project, but we can't handle this).
 
  At the same time #pragma comment shouldn't expanded in library source
files, elsewere the linker will search libstdxx.lib while linking the library
itself and will fail with the error "libstdxx.lib not found".
 
  The negative effect of the using autolinking feature is the case when user
uses the some part of the library, that fully implemented in header files
and the user don't have to link its project with stdcxx library, but
#pragma comment will force the linker to search and use the specified library.
For that case there handled _RWSTD_NO_EXT_AUTOLINK macro.

Farid.
 

Re: _RWSTD_LIB_SRC macro is not #defined in src/export.cpp

Posted by Martin Sebor <se...@roguewave.com>.
Farid Zaripov wrote:
> From: Martin Sebor [mailto:sebor@roguewave.com]
> To: stdcxx-dev@incubator.apache.org
> Subject: Re: _RWSTD_LIB_SRC macro is not #defined in src/export.cpp
> 
> Farid Zaripov wrote:
>>>   I've found that _RWSTD_LIB_SRC macro is not #defined in src/export.cpp
>>> file.
>>>
>>>   This is a mistake, or it's required by design?
> 
>> The file is currently only used when compiling with EDG eccp when
>> exported templates are enabled. I don't think (but I'm not 100%
>> sure) we want to #define _RWSTD_LIB_SRC in this case because the
>> effect is to #define _RWSTD_NO_TEMPLATE_DEFINITIONS.
>  
>   If so, I think it would be more correctly to #define _RWSTD_LIB_SRC
> and also #define _RWSTD_INSTANTIATE_TEMPLATES.

The _RWSTD_INSTANTIATE_TEMPLATES part is an implementation detail
of _RWSTD_LIB_SRC. If we were to add another detail like that we'd
have to also remember to update export.cpp. That seems just as
brittle as what we're doing now (i.e., not #defining _RWSTD_LIB_SRC).

>  
>   The #define _RWSTD_LIB_SRC in every library src file is needed
> for the implementing the autolinking feature on MSVC.

I see. You're adding a #pragma comment to _config.h that expands
when _RWSTD_LIB_SRC is #defined and you need it to expand in all
library sources, correct?

Martin

Re: _RWSTD_LIB_SRC macro is not #defined in src/export.cpp

Posted by Farid Zaripov <Fa...@epam.com>.
From: Martin Sebor [mailto:sebor@roguewave.com]
To: stdcxx-dev@incubator.apache.org
Subject: Re: _RWSTD_LIB_SRC macro is not #defined in src/export.cpp

Farid Zaripov wrote:
>>   I've found that _RWSTD_LIB_SRC macro is not #defined in src/export.cpp
>> file.
>>
>>   This is a mistake, or it's required by design?

> The file is currently only used when compiling with EDG eccp when
> exported templates are enabled. I don't think (but I'm not 100%
> sure) we want to #define _RWSTD_LIB_SRC in this case because the
> effect is to #define _RWSTD_NO_TEMPLATE_DEFINITIONS.
 
  If so, I think it would be more correctly to #define _RWSTD_LIB_SRC
and also #define _RWSTD_INSTANTIATE_TEMPLATES.
 
  The #define _RWSTD_LIB_SRC in every library src file is needed
for the implementing the autolinking feature on MSVC.
 
Farid.
 

Re: _RWSTD_LIB_SRC macro is not #defined in src/export.cpp

Posted by Martin Sebor <se...@roguewave.com>.
Farid Zaripov wrote:
>   I've found that _RWSTD_LIB_SRC macro is not #defined in src/export.cpp
> file.
> 
>   This is a mistake, or it's required by design?

The file is currently only used when compiling with EDG eccp when
exported templates are enabled. I don't think (but I'm not 100%
sure) we want to #define _RWSTD_LIB_SRC in this case because the
effect is to #define _RWSTD_NO_TEMPLATE_DEFINITIONS. You will
need to give it a try to see what happens. If nothing breaks
we should probably #define it. If it doesn't work because of
exported templates we should probably add a comment to the file
explaining the restriction so that someone doesn't accidentally
cause a regression by following the convention used in the rest
of library sources.

Martin

> 
> Farid.