Solaris fixes
[shibboleth/cpp-xmltooling.git] / xmltooling / base.h
index 5ae111c..664a6a0 100644 (file)
         } \
         void set##proper(int proper) { \
             try { \
-                xmltooling::xstring buf = boost::lexical_cast<xmltooling::xstring>(proper); \
-                set##proper(buf.c_str()); \
+                std::string buf(boost::lexical_cast<std::string>(proper)); \
+                xmltooling::auto_ptr_XMLCh widen(buf.c_str()); \
+                set##proper(widen.get()); \
             } \
             catch (boost::bad_lexical_cast&) { \
             } \
     XMLTOOLING_DOXYGEN(Sets proper.) \
     void set##proper(int proper) { \
         try { \
-            xmltooling::xstring buf = boost::lexical_cast<xmltooling::xstring>(proper); \
-            setTextContent(buf.c_str()); \
+            std::string buf(boost::lexical_cast<std::string>(proper)); \
+            xmltooling::auto_ptr_XMLCh widen(buf.c_str()); \
+            setTextContent(widen.get()); \
         } \
         catch (boost::bad_lexical_cast&) { \
         } \