void* result = 0; nsGetWeakReference(aInstancePtr, aErrorPtr)(NS_GET_IID(nsIWeakReference), &result); return NS_STATIC_CAST(nsIWeakReference*, result);
nsresult status;  nsIWeakReference* result = nsnull;  if ( aInstancePtr ) { nsCOMPtr<nsISupportsWeakReference> factoryPtr = do_QueryInterface(aInstancePtr, &status); NS_ASSERTION(factoryPtr, "Oops!  You're asking for a weak reference to an object that doesn't support that."); if ( factoryPtr ) { status = factoryPtr->GetWeakReference(&result); }  } else status = NS_ERROR_NULL_POINTER;  if ( aErrorPtr ) *aErrorPtr = status; return result;
NS_GetWeakReference( nsISupports* aInstancePtr, nsresult* aErrorPtr )  {    void* result = 0;    nsGetWeakReference(aInstancePtr, aErrorPtr)(NS_GET_IID(nsIWeakReference), &result);    return NS_STATIC_CAST(nsIWeakReference*, result);  }