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: r597425 - in /incubator/stdcxx/branches/4.2.x: include/ansi/cwchar tests/strings/21.cwchar.cpp
Date Wed, 28 Nov 2007 16:21:19 GMT
faridz@apache.org wrote:
> Author: faridz
> Date: Thu Nov 22 07:20:29 2007
> New Revision: 597425
> 
> URL: http://svn.apache.org/viewvc?rev=597425&view=rev

If _RWSTD_STRICT_ANSI is not #defined and one or both of getwc
or putwc is shadowed by a macro, aren't the using declarations
for the two functions going to cause problems?

Martin

> Log:
> 2007-11-21 Farid Zaripov <farid_zaripov@epam.com>
> 
> 	STDCXX-637
> 	* include/ansi/cwchar [_RWSTD_STRICT_ANSI]: #undefine getwc
> 	and putwc masking macros.
> 	* tests/strings/21.cwchar.cpp (test_macros): Issue rw_warn()
> 	instead of rw_assert() in non strict ANSI mode.
> 	(test_functions): Issue rw_warn() instead of rw_assert().
> 
> Modified:
>     incubator/stdcxx/branches/4.2.x/include/ansi/cwchar
>     incubator/stdcxx/branches/4.2.x/tests/strings/21.cwchar.cpp
> 
> Modified: incubator/stdcxx/branches/4.2.x/include/ansi/cwchar
> URL: http://svn.apache.org/viewvc/incubator/stdcxx/branches/4.2.x/include/ansi/cwchar?rev=597425&r1=597424&r2=597425&view=diff
> ==============================================================================
> --- incubator/stdcxx/branches/4.2.x/include/ansi/cwchar (original)
> +++ incubator/stdcxx/branches/4.2.x/include/ansi/cwchar Thu Nov 22 07:20:29 2007
> @@ -46,6 +46,13 @@
>  #include _RWSTD_ANSI_C_WCHAR_H
>  
>  
> +#ifdef _RWSTD_STRICT_ANSI
> +// 17.4.1.2, p6 - masking macros are not allowed
> +#  undef getwc
> +#  undef putwc
> +#endif   // _RWSTD_STRICT_ANSI
> +
> +
>  #if _RWSTD_NAMESPACE_STD_OPEN == 17
>  #undef _RWSTD_NAMESPACE_STD_OPEN
>  
> 
> Modified: incubator/stdcxx/branches/4.2.x/tests/strings/21.cwchar.cpp
> URL: http://svn.apache.org/viewvc/incubator/stdcxx/branches/4.2.x/tests/strings/21.cwchar.cpp?rev=597425&r1=597424&r2=597425&view=diff
> ==============================================================================
> --- incubator/stdcxx/branches/4.2.x/tests/strings/21.cwchar.cpp (original)
> +++ incubator/stdcxx/branches/4.2.x/tests/strings/21.cwchar.cpp Thu Nov 22 07:20:29 2007
> @@ -509,9 +509,15 @@
>      }
>  
>      for (unsigned i = 0; masking_macros [i]; ++i) {
> +#ifdef _RWSTD_STRICT_ANSI
>          rw_assert ('\0' == masking_macros [i][0], 0, __LINE__,
>                     "masking macro %s unexpectedly defined",
>                     masking_macros [i]);
> +#else
> +        rw_warn ('\0' == masking_macros [i][0], 0, __LINE__,
> +                 "masking macro %s unexpectedly defined",
> +                 masking_macros [i]);
> +#endif
>      }
>  }
>  
> @@ -855,13 +861,13 @@
>                   std_name, #fun, overload < 0, 0 == overload);          \
>          const char* const return_type_name =                            \
>              get_type_name ((T)0, std::fun args);                        \
> -        rw_assert (0 == ncalls, 0, __LINE__,                            \
> -                   "%s::%s("                                            \
> -                   "%{?}%{:}/* %{?}non-%{;}const overload */%{;}) "     \
> -                   "not declared (_RWSTD_NO_%s = %d, "                  \
> -                   "_RWSTD_NO_%s_IN_LIBC = %d)",                        \
> -                   std_name, #fun, overload < 0, 0 == overload,         \
> -                   #macro, EVAL (macro), #macro, EVAL_IN_LIBC (macro)); \
> +        rw_warn (0 == ncalls, 0, __LINE__,                              \
> +                 "%s::%s("                                              \
> +                 "%{?}%{:}/* %{?}non-%{;}const overload */%{;}) "       \
> +                 "not declared (_RWSTD_NO_%s = %d, "                    \
> +                 "_RWSTD_NO_%s_IN_LIBC = %d)",                          \
> +                 std_name, #fun, overload < 0, 0 == overload,           \
> +                 #macro, EVAL (macro), #macro, EVAL_IN_LIBC (macro));   \
>          if (0 == ncalls)                                                \
>              rw_assert (0 == return_type_name, 0, __LINE__, "%s::%s("    \
>                         "%{?}%{:}/* %{?}non-%{;}const overload */%{;}) " \
> 
> 


Mime
View raw message