incubator-stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Farid Zaripov" <Farid_Zari...@epam.com>
Subject RE: svn commit: r564059 - in /incubator/stdcxx/trunk: include/limits src/limits_bits.cpp
Date Thu, 09 Aug 2007 17:12:14 GMT
> -----Original Message-----
> From: sebor@apache.org [mailto:sebor@apache.org] 
> Sent: Thursday, August 09, 2007 3:48 AM
> To: stdcxx-commits@incubator.apache.org
> Subject: svn commit: r564059 - in /incubator/stdcxx/trunk: 
> include/limits src/limits_bits.cpp
> 
> Author: sebor
> Date: Wed Aug  8 17:47:54 2007
> New Revision: 564059
> 
> URL: http://svn.apache.org/viewvc?view=rev&rev=564059
> Log:
> 2007-08-09  Martin Sebor  <sebor@roguewave.com>
> 
> 	STDCXX-509
> 	* limits (__rw_flt_denorm_min, __rw_flt_infinity, __rw_flt_qNaN,
> 	__rw_flt_sNaN, __rw_dbl_denorm_min, __rw_dbl_infinity, 
> __rw_dbl_qNaN,
> 	__rw_dbl_sNaN, __rw_ldbl_denorm_min, 
> __rw_ldbl_infinity, __rw_ldbl_qNaN,
> 	__rw_ldbl_sNaN): Declared floating point constants with 
> "C" language
> 	linkage to prevent "clever" compilers such as MSVC from 
> mangling their
> 	type into their names and to permit them to be defined 
> with different
> 	types.
> 	* limits_bits.cpp (__rw_flt_denorm_min, __rw_flt_infinity,
> 	__rw_flt_qNaN, __rw_flt_sNaN, __rw_dbl_denorm_min, 
> __rw_dbl_infinity,
> 	__rw_dbl_qNaN, __rw_dbl_sNaN, __rw_ldbl_denorm_min, 
> __rw_ldbl_infinity,
> 	__rw_ldbl_qNaN, __rw_ldbl_sNaN): Defined as statically 
> (i.e., at load
> 	time as opposed to dynamically, at runtime) initialized 
> unions, backed
> 	by the appropriate byte patterns, with "C" language 
> linkage to permit
> 	the defintions to have a different type than the declarations.
> 	(__rw_flt_denorm_min_bits, __rw_flt_infinity_bits, 
> __rw_flt_qNaN_bits,
> 	__rw_flt_sNaN_bits, __rw_dbl_denorm_min_bits, 
> __rw_dbl_infinity_bits,
> 	__rw_dbl_qNaN_bits, __rw_dbl_sNaN_bits, 
> __rw_ldbl_denorm_min_bits,
> 	__rw_ldbl_infinity_bits, __rw_ldbl_qNaN_bits,  
> __rw_ldbl_sNaN_bits):
> 	Removed.
> 

  The __rw_xxx_infinity variables also declared in num_get.cpp
(without extern "C" at this time). So some tests are failed
to link:
libstd15s.lib(num_get.obj) : error LNK2001: unresolved external symbol
"double const __rw::__rw_dbl_infinity" (?__rw_dbl_infinity@__rw@@3NB)
libstd15s.lib(num_get.obj) : error LNK2001: unresolved external symbol
"float const __rw::__rw_flt_infinity" (?__rw_flt_infinity@__rw@@3MB)

  The proposed patch below:

  ChangeLog:
  STDCXX-509
  * num_get.cpp: Declared floating constants with "C" linkage
  for consistency with r564059 patch

Index: num_get.cpp
===================================================================
--- num_get.cpp	(revision 564143)
+++ num_get.cpp	(working copy)
@@ -82,11 +82,16 @@
 
 typedef unsigned char UChar;
 
+extern "C" {
 
 extern const float       __rw_flt_infinity;
 extern const double      __rw_dbl_infinity;
+
+#ifndef _RWSTD_NO_LONG_DOUBLE
 extern const long double __rw_ldbl_infinity;
+#endif   // _RWSTD_NO_LONG_DOUBLE
 
+}   // extern "C"
 
 const char*
 __rw_get_stdio_fmat (char buf [32], int type, unsigned fmtflags, int
prec);

Farid.

Mime
View raw message