Source: gjs Version: 1.30.0-2 Severity: serious gjs fails to build after the latest update of iceweasel from 8.0 → 9.0. I tried updating gjs (patch attached) but I don't know enough of mozjs and gjs to fix the remaining failure:
# make -k make all-am make[1]: Entering directory `/home/michael/debian/build-area/gjs-1.30.0' \ # source='gi/boxed.c' object='libgjs_la-boxed.lo' libtool=yes /bin/bash ./libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -pthread -DXP_UNIX -DJS_THREADSAFE -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/nspr -I/usr/include/gobject-introspection-1.0 -I/usr/include/mozjs -DGJS_TOP_SRCDIR=\".\" -DGJS_JS_DIR=\"/usr/share/gjs-1.0\" -DGJS_NATIVE_DIR=\"/usr/lib/gjs-1.0\" -DPKGLIBDIR=\"/usr/lib/gjs\" -I./gi -DGJS_COMPILATION -Wnested-externs -Wmissing-prototypes -Wsign-compare -Wcast-align -Wpointer-arith -Wmissing-declarations -Wchar-subscripts -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -Wall -c -o libgjs_la-boxed.lo `test -f 'gi/boxed.c' || echo './'`gi/boxed.c libtool: compile: gcc -DHAVE_CONFIG_H -I. -pthread -DXP_UNIX -DJS_THREADSAFE -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/nspr -I/usr/include/gobject-introspection-1.0 -I/usr/include/mozjs -DGJS_TOP_SRCDIR=\".\" -DGJS_JS_DIR=\"/usr/share/gjs-1.0\" -DGJS_NATIVE_DIR=\"/usr/lib/gjs-1.0\" -DPKGLIBDIR=\"/usr/lib/gjs\" -I./gi -DGJS_COMPILATION -Wnested-externs -Wmissing-prototypes -Wsign-compare -Wcast-align -Wpointer-arith -Wmissing-declarations -Wchar-subscripts -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -Wall -c gi/boxed.c -fPIC -DPIC -o .libs/libgjs_la-boxed.o gi/boxed.c:65:1: error: initializer element is not constant gi/boxed.c:65:1: error: (near initialization for 'unthreadsafe_template_for_constructor.parent_jsval') gi/boxed.c: In function 'type_can_be_allocated_directly': gi/boxed.c:1111:17: warning: enumeration value 'GI_INFO_TYPE_INVALID_0' not handled in switch [-Wswitch] make[1]: *** [libgjs_la-boxed.lo] Error 1 make[1]: Target `all-am' not remade because of errors. make[1]: Leaving directory `/home/michael/debian/build-area/gjs-1.30.0' make: *** [all] Error 2 Mike, do you maybe have an idea how to fix this build failure? Cheers, Michael -- System Information: Debian Release: wheezy/sid APT prefers unstable APT policy: (500, 'unstable'), (500, 'testing'), (200, 'experimental') Architecture: amd64 (x86_64) Kernel: Linux 3.1.0-1-amd64 (SMP w/4 CPU cores) Locale: LANG=de_DE.utf8, LC_CTYPE=de_DE.utf8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/dash -- no debconf information
Index: gjs-1.30.0/gi/boxed.c =================================================================== --- gjs-1.30.0.orig/gi/boxed.c 2011-12-23 04:49:26.940542601 +0100 +++ gjs-1.30.0/gi/boxed.c 2011-12-23 04:50:46.968539771 +0100 @@ -1267,7 +1267,7 @@ constructor = NULL; gjs_object_get_property(context, in_object, constructor_name, &value); - if (value != JSVAL_VOID) { + if (!JSVAL_IS_VOID(value)) { if (!JSVAL_IS_OBJECT(value)) { gjs_throw(context, "Property '%s' does not look like a constructor", constructor_name); Index: gjs-1.30.0/gi/function.c =================================================================== --- gjs-1.30.0.orig/gi/function.c 2011-12-23 04:49:26.960542601 +0100 +++ gjs-1.30.0/gi/function.c 2011-12-23 04:50:46.968539771 +0100 @@ -257,7 +257,7 @@ { GjsCallbackTrampoline *trampoline; - if (function == JSVAL_NULL) { + if (JSVAL_IS_NULL(function)) { return NULL; } Index: gjs-1.30.0/gi/object.c =================================================================== --- gjs-1.30.0.orig/gi/object.c 2011-12-23 04:49:26.884542603 +0100 +++ gjs-1.30.0/gi/object.c 2011-12-23 04:50:46.972539771 +0100 @@ -1404,7 +1404,7 @@ */ gjs_object_get_property(context, in_object, constructor_name, &value); constructor = NULL; - if (value != JSVAL_VOID) { + if (!JSVAL_IS_VOID(value)) { if (!JSVAL_IS_OBJECT(value)) { gjs_throw(context, "Property '%s' does not look like a constructor", constructor_name); Index: gjs-1.30.0/gi/param.c =================================================================== --- gjs-1.30.0.orig/gi/param.c 2011-12-23 04:49:26.920542602 +0100 +++ gjs-1.30.0/gi/param.c 2011-12-23 04:50:46.972539771 +0100 @@ -309,7 +309,7 @@ constructor_name = "ParamSpec"; gjs_object_get_property(context, in_object, constructor_name, &value); - if (value != JSVAL_VOID) { + if (!JSVAL_IS_VOID(value)) { JSObject *constructor; if (!JSVAL_IS_OBJECT(value)) { Index: gjs-1.30.0/gi/union.c =================================================================== --- gjs-1.30.0.orig/gi/union.c 2011-12-23 04:49:26.868542604 +0100 +++ gjs-1.30.0/gi/union.c 2011-12-23 04:50:46.972539771 +0100 @@ -511,7 +511,7 @@ if (constructor_p) { *constructor_p = NULL; gjs_object_get_property(context, in_object, constructor_name, &value); - if (value != JSVAL_VOID) { + if (!JSVAL_IS_VOID(value)) { if (!JSVAL_IS_OBJECT(value)) { gjs_throw(context, "Property '%s' does not look like a constructor", constructor_name); Index: gjs-1.30.0/gi/value.c =================================================================== --- gjs-1.30.0.orig/gi/value.c 2011-12-23 04:49:26.904542603 +0100 +++ gjs-1.30.0/gi/value.c 2011-12-23 04:50:46.972539771 +0100 @@ -124,7 +124,7 @@ gjs_closure_invoke(closure, argc, argv, &rval); if (return_value != NULL) { - if (rval == JSVAL_VOID) { + if (JSVAL_IS_VOID(rval)) { /* something went wrong invoking, error should be set already */ goto cleanup; } Index: gjs-1.30.0/gjs/byteArray.c =================================================================== --- gjs-1.30.0.orig/gjs/byteArray.c 2011-12-23 04:49:27.000542598 +0100 +++ gjs-1.30.0/gjs/byteArray.c 2011-12-23 04:50:46.972539771 +0100 @@ -775,7 +775,7 @@ goto out; } - if (elem == JSVAL_VOID) + if (JSVAL_IS_VOID(elem)) continue; if (!gjs_value_to_byte(context, elem, &b)) Index: gjs-1.30.0/gjs/importer.c =================================================================== --- gjs-1.30.0.orig/gjs/importer.c 2011-12-23 04:49:27.036542597 +0100 +++ gjs-1.30.0/gjs/importer.c 2011-12-23 04:50:46.976539771 +0100 @@ -534,7 +534,7 @@ goto out; } - if (elem == JSVAL_VOID) + if (JSVAL_IS_VOID(elem)) continue; if (!JSVAL_IS_STRING(elem)) { @@ -566,7 +566,7 @@ module_obj, name, &obj_val)) { - if (obj_val != JSVAL_VOID && + if (!JSVAL_IS_VOID(obj_val) && JS_DefineProperty(context, obj, name, obj_val, NULL, NULL, @@ -793,7 +793,7 @@ return JS_FALSE; } - if (elem == JSVAL_VOID) + if (JSVAL_IS_VOID(elem)) continue; if (!JSVAL_IS_STRING(elem)) { @@ -868,7 +868,7 @@ return JS_FALSE; } - if (*state_p == JSVAL_NULL) /* Iterating prototype */ + if (JSVAL_IS_NULL(*state_p)) /* Iterating prototype */ return JS_TRUE; iter = JSVAL_TO_PRIVATE(*state_p); @@ -890,7 +890,7 @@ } case JSENUMERATE_DESTROY: { - if (state_p && *state_p != JSVAL_NULL) { + if (state_p && !JSVAL_IS_NULL(*state_p)) { iter = JSVAL_TO_PRIVATE(*state_p); importer_iterator_free(iter); Index: gjs-1.30.0/gjs/jsapi-util.c =================================================================== --- gjs-1.30.0.orig/gjs/jsapi-util.c 2011-12-23 04:49:27.056542596 +0100 +++ gjs-1.30.0/gjs/jsapi-util.c 2011-12-23 04:50:46.976539771 +0100 @@ -407,7 +407,7 @@ JS_EndRequest(context); - return value != JSVAL_VOID; + return !JSVAL_IS_VOID(value); } /* Returns whether the object had the property; if the object did @@ -434,7 +434,7 @@ if (value_p) *value_p = value; - if (value != JSVAL_VOID) { + if (!JSVAL_IS_VOID(value)) { JS_ClearPendingException(context); /* in case JS_GetProperty() was on crack */ JS_EndRequest(context); return TRUE; @@ -550,7 +550,7 @@ class_copy->base.name, &value)) goto error; } - g_assert(value != JSVAL_VOID); + g_assert(!JSVAL_IS_VOID(value)); g_assert(prototype != NULL); /* Now manually define our constructor with a sane name, in the @@ -1277,7 +1277,7 @@ { if (JSVAL_IS_NULL(value)) { return "null"; - } else if (value == JSVAL_VOID) { + } else if (JSVAL_IS_VOID(value)) { return "undefined"; } else if (JSVAL_IS_INT(value)) { return "integer"; Index: gjs-1.30.0/gjs/jsapi-util.h =================================================================== --- gjs-1.30.0.orig/gjs/jsapi-util.h 2011-12-23 04:49:26.980542599 +0100 +++ gjs-1.30.0/gjs/jsapi-util.h 2011-12-23 04:50:46.976539771 +0100 @@ -184,7 +184,7 @@ } \ if (!JS_DefineProperty(context, module, proto_name, \ rval, NULL, NULL, GJS_MODULE_PROP_FLAGS)) \ - return JS_FALSE; \ + return JSVAL_FALSE; \ return rval; \ } Index: gjs-1.30.0/gjs/native.c =================================================================== --- gjs-1.30.0.orig/gjs/native.c 2011-12-23 04:49:27.016542599 +0100 +++ gjs-1.30.0/gjs/native.c 2011-12-23 04:50:46.976539771 +0100 @@ -82,7 +82,7 @@ jsval value; if (gjs_object_get_property(context, module_obj, "__parentModule__", &value) && - value != JSVAL_NULL && + !JSVAL_IS_NULL(value) && JSVAL_IS_OBJECT(value)) { return JSVAL_TO_OBJECT(value); } else { Index: gjs-1.30.0/modules/cairo-context.c =================================================================== --- gjs-1.30.0.orig/modules/cairo-context.c 2011-12-23 04:49:26.772542607 +0100 +++ gjs-1.30.0/modules/cairo-context.c 2011-12-23 04:50:46.980539770 +0100 @@ -574,7 +574,7 @@ if (!JS_GetElement(context, dashes, i, &elem)) { goto out; } - if (elem == JSVAL_VOID) + if (JSVAL_IS_VOID(elem)) continue; if (!JS_ValueToNumber(context, elem, &b)) Index: gjs-1.30.0/modules/cairo.c =================================================================== --- gjs-1.30.0.orig/modules/cairo.c 2011-12-23 04:49:26.828542605 +0100 +++ gjs-1.30.0/modules/cairo.c 2011-12-23 04:50:46.980539770 +0100 @@ -52,73 +52,73 @@ obj = gjs_cairo_context_create_proto(context, module, "Context", NULL); - if (obj == JSVAL_NULL) + if (JSVAL_IS_NULL(obj)) return JS_FALSE; gjs_cairo_context_init(context); obj = gjs_cairo_surface_create_proto(context, module, "Surface", NULL); - if (obj == JSVAL_NULL) + if (JSVAL_IS_NULL(obj)) return JS_FALSE; surface_proto = JSVAL_TO_OBJECT(obj); obj = gjs_cairo_image_surface_create_proto(context, module, "ImageSurface", surface_proto); - if (obj == JSVAL_NULL) + if (JSVAL_IS_NULL(obj)) return JS_FALSE; gjs_cairo_image_surface_init(context, JSVAL_TO_OBJECT(obj)); #if CAIRO_HAS_PS_SURFACE obj = gjs_cairo_ps_surface_create_proto(context, module, "PSSurface", surface_proto); - if (obj == JSVAL_NULL) + if (JSVAL_IS_NULL(obj)) return JS_FALSE; #endif #if CAIRO_HAS_PDF_SURFACE obj = gjs_cairo_pdf_surface_create_proto(context, module, "PDFSurface", surface_proto); - if (obj == JSVAL_NULL) + if (JSVAL_IS_NULL(obj)) return JS_FALSE; #endif #if CAIRO_HAS_SVG_SURFACE obj = gjs_cairo_svg_surface_create_proto(context, module, "SVGSurface", surface_proto); - if (obj == JSVAL_NULL) + if (JSVAL_IS_NULL(obj)) return JS_FALSE; #endif obj = gjs_cairo_pattern_create_proto(context, module, "Pattern", NULL); - if (obj == JSVAL_NULL) + if (JSVAL_IS_NULL(obj)) return JS_FALSE; pattern_proto = JSVAL_TO_OBJECT(obj); obj = gjs_cairo_gradient_create_proto(context, module, "Gradient", pattern_proto); - if (obj == JSVAL_NULL) + if (JSVAL_IS_NULL(obj)) return JS_FALSE; gradient_proto = JSVAL_TO_OBJECT(obj); obj = gjs_cairo_linear_gradient_create_proto(context, module, "LinearGradient", gradient_proto); - if (obj == JSVAL_NULL) + if (JSVAL_IS_NULL(obj)) return JS_FALSE; obj = gjs_cairo_radial_gradient_create_proto(context, module, "RadialGradient", gradient_proto); - if (obj == JSVAL_NULL) + if (JSVAL_IS_NULL(obj)) return JS_FALSE; obj = gjs_cairo_surface_pattern_create_proto(context, module, "SurfacePattern", pattern_proto); - if (obj == JSVAL_NULL) + if (JSVAL_IS_NULL(obj)) return JS_FALSE; obj = gjs_cairo_solid_pattern_create_proto(context, module, "SolidPattern", pattern_proto); - if (obj == JSVAL_NULL) + if (JSVAL_IS_NULL(obj)) return JS_FALSE; return JS_TRUE; Index: gjs-1.30.0/modules/console.c =================================================================== --- gjs-1.30.0.orig/modules/console.c 2011-12-23 04:49:26.808542606 +0100 +++ gjs-1.30.0/modules/console.c 2011-12-23 04:50:46.980539770 +0100 @@ -224,7 +224,7 @@ if (JS_GetPendingException(context, &result)) { str = JS_ValueToString(context, result); JS_ClearPendingException(context); - } else if (result == JSVAL_VOID) { + } else if (JSVAL_IS_VOID(result)) { goto next; } else { str = JS_ValueToString(context, result); Index: gjs-1.30.0/modules/dbus-exports.c =================================================================== --- gjs-1.30.0.orig/modules/dbus-exports.c 2011-12-23 04:49:26.792542607 +0100 +++ gjs-1.30.0/modules/dbus-exports.c 2011-12-23 04:50:46.980539770 +0100 @@ -252,7 +252,7 @@ dbus_message_iter_init_append(reply, &arg_iter); - if (rval == JSVAL_VOID || g_str_equal(signature, "")) { + if (JSVAL_IS_VOID(rval) || g_str_equal(signature, "")) { /* We don't want to send anything in these cases so skip the * marshalling altogether. */ @@ -681,7 +681,7 @@ gjs_object_get_property(context, obj, elements[i], &value); - if (value == JSVAL_VOID || + if (JSVAL_IS_VOID(value) || JSVAL_IS_NULL(value) || !JSVAL_IS_OBJECT(value)) { obj = NULL; @@ -701,7 +701,7 @@ if (obj != NULL) { gjs_object_get_property(context, obj, "-impl-", &value); - if (value == JSVAL_VOID || + if (JSVAL_IS_VOID(value) || JSVAL_IS_NULL(value) || !JSVAL_IS_OBJECT(value)) { obj = NULL; @@ -724,7 +724,7 @@ method_name, method_value); - if (*method_value == JSVAL_VOID || + if (JSVAL_IS_VOID(*method_value) || JSVAL_IS_NULL(*method_value) || !JSVAL_IS_OBJECT(*method_value)) { return JS_FALSE; @@ -772,7 +772,7 @@ * have any properties so there's no case where * we actually want to use it. */ - if (iface_val == JSVAL_VOID && + if (JSVAL_IS_VOID(iface_val) && strcmp(iface, DBUS_INTERFACE_PROPERTIES) == 0) { gjs_debug(GJS_DEBUG_DBUS, "Changing interface to work around GNOME bug 569933"); @@ -785,7 +785,7 @@ } } - if (iface_val == JSVAL_VOID) { + if (JSVAL_IS_VOID(iface_val)) { /* NOT an exception ... object simply lacks the interface */ return JS_TRUE; } @@ -938,7 +938,7 @@ return JS_FALSE; } - if (properties_array_val == JSVAL_VOID) { + if (JSVAL_IS_VOID(properties_array_val)) { /* NOT an exception ... interface simply has no properties */ return JS_TRUE; } @@ -949,7 +949,7 @@ property_val = JSVAL_VOID; if (!JS_GetElement(context, JSVAL_TO_OBJECT(properties_array_val), i, &property_val) || - property_val == JSVAL_VOID) { + JSVAL_IS_VOID(property_val)) { gjs_throw(context, "Error accessing element %d of properties array", i); @@ -1150,7 +1150,7 @@ dbus_message_iter_open_container(&iter, DBUS_TYPE_ARRAY, "{sv}", &dict_iter); - if (properties_array_val != JSVAL_VOID) { + if (!JSVAL_IS_VOID(properties_array_val)) { for (i = 0; i < length; ++i) { jsval property_val; PropertyDetails details; @@ -1162,7 +1162,7 @@ property_val = JSVAL_VOID; if (!JS_GetElement(context, JSVAL_TO_OBJECT(properties_array_val), i, &property_val) || - property_val == JSVAL_VOID) { + JSVAL_IS_VOID(property_val)) { gjs_throw(context, "Error accessing element %d of properties array", i); Index: gjs-1.30.0/modules/dbus-values.c =================================================================== --- gjs-1.30.0.orig/modules/dbus-values.c 2011-12-23 04:49:26.848542605 +0100 +++ gjs-1.30.0/modules/dbus-values.c 2011-12-23 04:50:46.984539770 +0100 @@ -794,14 +794,14 @@ "_dbus_signatures", &prop_signatures); - if (prop_signatures != JSVAL_VOID && + if (!JSVAL_IS_VOID(prop_signatures) && !JSVAL_IS_OBJECT(prop_signatures)) { gjs_throw(context, "_dbus_signatures prop must be an object"); return JS_FALSE; } - if (prop_signatures != JSVAL_VOID && + if (!JSVAL_IS_VOID(prop_signatures) && dbus_signature_iter_get_current_type(&dict_value_sig_iter) != DBUS_TYPE_VARIANT) { gjs_throw(context, @@ -839,13 +839,13 @@ /* see if this prop has a forced signature */ value_signature = NULL; - if (prop_signatures != JSVAL_VOID) { + if (!JSVAL_IS_VOID(prop_signatures)) { jsval signature_value; signature_value = JSVAL_VOID; gjs_object_get_property(context, JSVAL_TO_OBJECT(prop_signatures), name, &signature_value); - if (signature_value != JSVAL_VOID) { + if (!JSVAL_IS_VOID(signature_value)) { value_signature = gjs_string_get_ascii(context, signature_value); if (value_signature == NULL) { @@ -1020,7 +1020,7 @@ if (!append_dict(context, iter, sig_iter, obj)) return JS_FALSE; } - } else if (value == JSVAL_VOID) { + } else if (JSVAL_IS_VOID(value)) { gjs_debug(GJS_DEBUG_DBUS, "Can't send void (undefined) values over dbus"); gjs_throw(context, "Can't send void (undefined) values over dbus"); return JS_FALSE; Index: gjs-1.30.0/gjs/jsapi-private.cpp =================================================================== --- gjs-1.30.0.orig/gjs/jsapi-private.cpp 2011-12-23 04:49:27.076542597 +0100 +++ gjs-1.30.0/gjs/jsapi-private.cpp 2011-12-23 06:44:44.909713645 +0100 @@ -31,6 +31,10 @@ #include "jsapi-private.h" #include "compat.h" +#ifndef UINT32_MAX +#define UINT32_MAX 4294967295U +#endif + #include <string.h> #include <jscntxt.h>