> -----Original Message-----
> From: Dennis Clarke [mailto:[email protected]]
> Sent: Wednesday, October 5, 2016 5:00 PM
> To: [email protected]
> Subject: [PHP-DEV] ext/fileinfo/libmagic/apprentice.c", line 2195: error:
> syntax
> error
>
>
> I tried the php-install mail list but saw no reply thus I will try here.
>
>
> While attempting a build of 7.0.11 I was presented with :
>
> "/usr/local/build/php-
> 7.0.11_SunOS5.10_sparcv9.001/ext/fileinfo/libmagic/apprentice.c",
>
> line 2195: error: syntax error before or at: struct "/usr/local/build/php-
> 7.0.11_SunOS5.10_sparcv9.001/ext/fileinfo/libmagic/apprentice.c",
>
> line 2209: error: syntax error before or at: struct
> cc: acomp failed for
> /usr/local/build/php-
> 7.0.11_SunOS5.10_sparcv9.001/ext/fileinfo/libmagic/apprentice.c
> gmake: *** [ext/fileinfo/libmagic/apprentice.lo] Error 1
>
>
> The problem appears to be in a strange placement of the keyword "struct" :
>
What is strange with the struct? Looks more like there is some missing some
datatype or macro.
> 2189 private int
> 2190 parse_apple(struct magic_set *ms, struct magic_entry *me, const char
> *line)
> 2191 {
> 2192 struct magic *m = &me->mp[0];
> 2193
> 2194 return parse_extra(ms, me, line,
> 2195 CAST(off_t, offsetof(struct magic, apple)),
> 2196 sizeof(m->apple), "APPLE", "!+-./", 0);
> 2197 }
> 2198
>
> also
>
> 2203 private int
> 2204 parse_mime(struct magic_set *ms, struct magic_entry *me, const char
> *line)
> 2205 {
> 2206 struct magic *m = &me->mp[0];
> 2207
> 2208 return parse_extra(ms, me, line,
> 2209 CAST(zend_off_t, offsetof(struct magic, mimetype)),
> 2210 sizeof(m->mimetype), "MIME", "+-/.", 1);
> 2211 }
> 2212
>
>
> Not sure where the definition of "offsetof()" is located but something seems
> clearly not C compliant here.
>
Just to be sure. If you include stddef.h directly, does it fix it? Normally
stddef.h were included from php.h already,
It could make sense otherwise to generate the preprocessed source and check the
exact code produced. If you see something strange, it might be helpful to ifdef
out some piece of code to check it were the cause. Otherwise, quite hard to
guess what's happening, but likely some missing macro or datatype.
Regards
Anatol
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php