summaryrefslogtreecommitdiff
path: root/debian/patches/0100-C++Parser_Expat_support.patch
blob: f37ea029bf60fc3ebcee15a39a3d8eeccca205e4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
Description: Fix bug in C++/Parser Expat support.
Author: Jörg Frings-Fürst <debian@jff-webhosting.net>
Origin: http://scm.codesynthesis.com/?p=xsd/xsd.git;a=commit;h=94cba986108a0e0f42295572ca42c356d59328d7
        http://scm.codesynthesis.com/?p=xsd/xsd.git;a=commit;h=0e5fab0664fb36c6253dfd7bb86d8985d1b349ef
Forwarded: not-needed
Last-Update: 2016-04-10
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
Index: trunk/xsd/libxsd/xsd/cxx/parser/expat/elements.hxx
===================================================================
--- trunk.orig/xsd/libxsd/xsd/cxx/parser/expat/elements.hxx
+++ trunk/xsd/libxsd/xsd/cxx/parser/expat/elements.hxx
@@ -51,7 +51,9 @@ namespace xsd
           }
         };
 
-        typedef std::unique_ptr<XML_ParserStruct> parser_auto_ptr;
+        typedef
+        std::unique_ptr<XML_ParserStruct, parser_deleter>
+        parser_auto_ptr;
 #else
         // Simple auto pointer for Expat's XML_Parser object.
         //
Index: trunk/xsd/libxsd/xsd/cxx/parser/expat/elements.txx
===================================================================
--- trunk.orig/xsd/libxsd/xsd/cxx/parser/expat/elements.txx
+++ trunk/xsd/libxsd/xsd/cxx/parser/expat/elements.txx
@@ -279,13 +279,14 @@ namespace xsd
         {
           parser_auto_ptr parser (XML_ParserCreateNS (0, XML_Char (' ')));
 
-          if (parser == 0)
+          if (parser.get () == 0)
             throw std::bad_alloc ();
 
           if (system_id || public_id)
-            parse_begin (parser, system_id ? *system_id : *public_id, eh);
+            parse_begin (
+             parser.get (), system_id ? *system_id : *public_id, eh);
           else
-            parse_begin (parser, eh);
+            parse_begin (parser.get (), eh);
 
           // Temporarily unset the exception failbit. Also clear the
           // fail bit when we reset the old state if it was caused
@@ -309,9 +310,10 @@ namespace xsd
               //
               break;
             }
-
-            if (XML_Parse (
-                  parser, buf, is.gcount (), is.eof ()) == XML_STATUS_ERROR)
+            if (XML_Parse (parser.get (),
+                           buf,
+                           is.gcount (),
+                           is.eof ()) == XML_STATUS_ERROR)
             {
               r = false;
               break;