Aaron Crane avatar Aaron Crane committed c7644f7

Fix compilation bugs in Devel.xs

In XS functions, local variable declarations must be in the `PREINIT`
section, not `CODE`, at least for some compiler/OS combinations.

Comments (0)

Files changed (1)

 node_to_perl( n, o = NULL )
         void * n
         void * o
-    CODE:
+    PREINIT:
         xmlNode *node = n;
         xmlNode *owner = o;
+    CODE:
         RETVAL = PmmNodeToSv(node , owner?owner->_private:NULL );
     OUTPUT:
         RETVAL
 void *
 node_from_perl( sv )
         SV *sv
+    PREINIT:
+        xmlNode *n = PmmSvNodeExt(sv, 0);
     CODE:
-        xmlNode *n = PmmSvNodeExt(sv, 0);
         RETVAL = n;
     OUTPUT:
         RETVAL
 void 
 refcnt_inc( n )
         void *n
+    PREINIT:
+        xmlNode *node = n;
     CODE:
-        xmlNode *node = n;
         PmmREFCNT_inc(((ProxyNode *)(node->_private)));
 
 int 
 refcnt_dec( n )
         void *n
+    PREINIT:
+        xmlNode *node = n;
     CODE:
-        xmlNode *node = n;
         RETVAL = PmmREFCNT_dec(((ProxyNode *)(node->_private)));
     OUTPUT:
         RETVAL
 int 
 refcnt( n )
         void *n
+    PREINIT:
+        xmlNode *node = n;
     CODE:
-        xmlNode *node = n;
         RETVAL = PmmREFCNT(((ProxyNode *)(node->_private)));
     OUTPUT:
         RETVAL
 fix_owner( n, p )
         void * n
         void * p
-    CODE:
+    PREINIT:
         xmlNode *node = n;
         xmlNode *parent = p;
+    CODE:
         RETVAL = PmmFixOwner(node->_private , parent->_private);
     OUTPUT:
         RETVAL
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.