+2019-10-13 Keith Marshall <keith@users.osdn.me>
+
+ Update to accommodate C++11 deprecation of "auto_ptr".
+
+ * tests/xmlcheck.cpp (unique_or_auto_ptr): New macro; define it...
+ [__cplusplus >= 201103L]: ...as "unique_ptr", for C++11 onward, or...
+ [__cplusplus < 201103L]: ...as "auto_ptr", for earlier C++.
+
2019-07-06 Keith Marshall <keith@users.osdn.me>
Publish MinGW.org WSL-5.2.2 package set.
*
*
* Adaptation by Keith Marshall <keithmarshall@users.sourceforge.net>
- * Copyright (C) 2013, MinGW.org Project
+ * Copyright (C) 2013, 2019, MinGW.org Project
*
* This is free software. Permission is granted to copy, modify and
* redistribute this software, under the provisions of the GNU General
#include <libgen.h> /* for basename() */
+#if __cplusplus >= 201103L
+/* C++11 deprecates auto_ptr, in favour of shared_ptr or unique_ptr;
+ * prefer the latter alternative, in this case.
+ */
+#define unique_or_auto_ptr unique_ptr
+#else
+/* Using a pre-C++11 compiler; must still use auto_ptr
+ */
+#define unique_or_auto_ptr auto_ptr
+#endif
+
#include <xercesc/util/XMLUni.hpp>
#include <xercesc/util/XMLString.hpp>
#include <xercesc/util/PlatformUtils.hpp>
/* Initialize a grammer pool, for use by our parser instances.
*/
MemoryManager* mm( XMLPlatformUtils::fgMemoryManager );
- auto_ptr<XMLGrammarPool> gp( new XMLGrammarPoolImpl( mm ) );
+ unique_or_auto_ptr<XMLGrammarPool> gp( new XMLGrammarPoolImpl( mm ) );
/* Load the schema definitions into the grammar pool.
*/