-(defmacro with-gvalue ((gvalue type &optional (value nil value-p)) &body body)
- `(let ((,gvalue ,(if value-p
- `(gvalue-new ,type ,value)
- `(gvalue-new))))
+(defbinding (gvalue-p "g_type_check_value") () boolean
+ (location pointer))
+
+(defmacro with-gvalue ((gvalue &optional type (value nil value-p)) &body body)
+ `(let ((,gvalue ,(cond
+ ((and type value-p) `(gvalue-new ,type ,value))
+ (type `(gvalue-new ,type))
+ (`(gvalue-new)))))