davidbyttow / govips

A lightning fast image processing and resizing library for Go
MIT License
1.23k stars 196 forks source link

'for' loop initial declarations are only allowed in C99 mode #426

Closed dAvagimyan closed 4 months ago

dAvagimyan commented 4 months ago

Hi there! I have an old OS (centos 7) in production and there is no way to update it or change the C++ assembly libraries. I got next error in building my app. I can't use the option -std=c99 since this should be used in the library itself. You have to copy the package and change the code manually. Is it possible to make the code backwards compatible for the old builder? int i; for (i = 0; i < n_pages; i++) { or may be you can add // #cgo CFLAGS: -std=c99 in conversion.go?

conversion.c: In function 'extract_area_multi_page':
conversion.c:147:3: error: 'for' loop initial declarations are only allowed in C99 mode
   for (int i = 0; i < n_pages; i++) {
tonimelisma commented 4 months ago

Ehhh. I suppose if you produce a PR and show that it doesn't break any tests on newer OS I could approve it.

dAvagimyan commented 4 months ago

https://github.com/davidbyttow/govips/pull/427/files