Author: faridz
Date: Fri Feb 23 06:07:59 2007
New Revision: 510948
URL: http://svn.apache.org/viewvc?view=rev&rev=510948
Log:
2007-02-23 Farid Zaripov <[EMAIL PROTECTED]>
ChangeLog:
* rw_value.h (_rw_user_class_fmat_init): New static variable
to install the formatting callback function for UserClass type.
* value.cpp (_rw_fmtxarray): Removed prototype of the function.
Installation of the formatting callback function moved from
UserClass ctor to UserClassFmatInit ctor.
Modified:
incubator/stdcxx/trunk/tests/include/rw_value.h
incubator/stdcxx/trunk/tests/src/value.cpp
Modified: incubator/stdcxx/trunk/tests/include/rw_value.h
URL:
http://svn.apache.org/viewvc/incubator/stdcxx/trunk/tests/include/rw_value.h?view=diff&rev=510948&r1=510947&r2=510948
==============================================================================
--- incubator/stdcxx/trunk/tests/include/rw_value.h (original)
+++ incubator/stdcxx/trunk/tests/include/rw_value.h Fri Feb 23 06:07:59 2007
@@ -273,4 +273,9 @@
};
+static const struct _TEST_EXPORT UserClassFmatInit {
+ UserClassFmatInit ();
+} _rw_user_class_fmat_init;
+
+
#endif // RW_VALUE_H_INCLUDED
Modified: incubator/stdcxx/trunk/tests/src/value.cpp
URL:
http://svn.apache.org/viewvc/incubator/stdcxx/trunk/tests/src/value.cpp?view=diff&rev=510948&r1=510947&r2=510948
==============================================================================
--- incubator/stdcxx/trunk/tests/src/value.cpp (original)
+++ incubator/stdcxx/trunk/tests/src/value.cpp Fri Feb 23 06:07:59 2007
@@ -89,20 +89,10 @@
/* static */ size_t UserClass::op_lt_throw_count_ = size_t (-1);
-static int
-_rw_fmtxarray (char**, size_t*, const char*, ...);
-
-
UserClass::UserClass ()
: id_ (++id_gen_), origin_ (id_), src_id_ (id_), val_ (0),
n_copy_ctor_ (0), n_op_assign_ (0), n_op_eq_ (0), n_op_lt_ (0)
{
- // push a new formatter function on top of the stack
- // of user-defined formatting callbacks invoked by
- // rw_printf() at al to process extended directives
- static int format_init = rw_printf ("%{+!}", _rw_fmtxarray);
- _RWSTD_UNUSED (format_init);
-
// increment the total number of invocations of the default ctor
// (do so even if the function throws an exception below)
++n_total_def_ctor_;
@@ -848,4 +838,16 @@
va_end (va);
return nbytes;
+}
+
+
+UserClassFmatInit::
+UserClassFmatInit ()
+{
+ // push a new formatter function on top of the stack
+ // of user-defined formatting callbacks invoked by
+ // rw_printf() at al to process extended directives
+ static int format_init = rw_printf ("%{+!}", _rw_fmtxarray);
+
+ _RWSTD_UNUSED (format_init);
}