From: Igor Sysoev Date: Tue, 13 Sep 2016 13:53:24 +0000 (+0300) Subject: Fixed building by GCC 4. X-Git-Tag: 0.1.2~1 X-Git-Url: http://git.kaiwu.me/postgresql/log/contrib/postgres_fdw/static/gitweb.js?a=commitdiff_plain;h=d0a49f4f0dc69a1d8dd47041a2a8e60fe593562c;p=njs.git Fixed building by GCC 4. --- diff --git a/njs/njs_builtin.c b/njs/njs_builtin.c index 3d74d09e..c493ca88 100644 --- a/njs/njs_builtin.c +++ b/njs/njs_builtin.c @@ -55,26 +55,31 @@ njs_builtin_objects_create(njs_vm_t *vm) }; static const njs_object_prototype_t prototype_values[] = { - { .object.type = NJS_OBJECT }, - { .object.type = NJS_ARRAY }, + /* + * GCC 4 complains about unitialized .shared field, + * if the .type field is initialized as .object.type. + */ + { .object = { .type = NJS_OBJECT } }, + { .object = { .type = NJS_ARRAY } }, /* * The .object.type field must be initialzed after the .value field, * otherwise SunC 5.9 treats the .value as .object.value or so. */ { .object_value = { .value = njs_value(NJS_BOOLEAN, 0, 0.0), - .object.type = NJS_OBJECT_BOOLEAN } }, + .object = { .type = NJS_OBJECT_BOOLEAN } } }, { .object_value = { .value = njs_value(NJS_NUMBER, 0, 0.0), - .object.type = NJS_OBJECT_NUMBER } }, + .object = { .type = NJS_OBJECT_NUMBER } } }, { .object_value = { .value = njs_string(""), - .object.type = NJS_OBJECT_STRING } }, + .object = { .type = NJS_OBJECT_STRING } } }, - { .object.type = NJS_FUNCTION }, - { .object.type = NJS_REGEXP }, + { .object = { .type = NJS_FUNCTION } }, + { .object = { .type = NJS_REGEXP } }, - { .date = { .time = NJS_NAN, .object.type = NJS_DATE } }, + { .date = { .time = NJS_NAN, + .object = { .type = NJS_DATE } } }, }; static const njs_object_init_t *constructor_init[] = {