Browse Source

allow void pointer types to return as a long int

toddw 12 years ago
parent
commit
54eb57a427
1 changed files with 5 additions and 1 deletions
  1. 5 1
      xpcom/src/VariantUtils.cpp

+ 5 - 1
xpcom/src/VariantUtils.cpp

@@ -2562,7 +2562,11 @@ PyObject *PyXPCOM_GatewayVariantHelper::MakeSingleParam(int index, PythonTypeDes
 		ret = PyUnicode_FromPRUnichar(&temp, 1);
 		break;
 		}
-//	  case nsXPTType::T_VOID:
+	  case nsXPTType::T_VOID:
+		// we really can't do anything useful with this; just pass it to
+		// Python as an integer and hope it's close enough
+		ret = PyLong_FromVoidPtr( *((void **)ns_v.ptr));
+		break;
 	  case nsXPTType::T_IID: {
 		  ret = Py_nsIID::PyObjectFromIID( * DEREF_IN_OR_OUT(ns_v.val.p, const nsIID *) );
 		  break;