Commits

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.

  • Participants
  • Parent commits f5545cb

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