diff -Naurb glpng-1.4.5/src/Makefile.HAIKU glpng-1.4.5-haiku/src/Makefile.HAIKU
|
old
|
new
|
|
| | 1 | LDFLAGS=-lpng -lGL |
| | 2 | SHAREDLIBFLAGS=-shared -fPIC |
| | 3 | DESTDIR=/boot/common |
| | 4 | LIB=lib |
| | 5 | INCPATH = -I../include |
| | 6 | |
| | 7 | all: libglpng.a libglpng.so.1.45 |
| | 8 | |
| | 9 | libglpng.a: glpng.o |
| | 10 | ar rv $@ $< |
| | 11 | |
| | 12 | libglpng.so.1.45: glpng.o |
| | 13 | gcc $(CFLAGS) $(SHAREDLIBFLAGS) -Wl,-soname=libglpng.so.1 -Wl $< -Wl $(LDFLAGS) -o $@ -lGL -lpng -lz |
| | 14 | |
| | 15 | glpng.o: glpng.c |
| | 16 | gcc $(CFLAGS) -c $< |
| | 17 | |
| | 18 | clean: |
| | 19 | rm glpng.o libglpng.* |
| | 20 | |
| | 21 | install: |
| | 22 | for i in include ../include/GL $(LIB); do \ |
| | 23 | install -m 755 -d $(DESTDIR)/$$i; \ |
| | 24 | done |
| | 25 | install -p -m 644 ../include/GL/glpng.h $(DESTDIR)/include/GL |
| | 26 | install -m 755 libglpng.* $(DESTDIR)/$(LIB) |
| | 27 | ln -s libglpng.so.1.45 $(DESTDIR)/$(LIB)/libglpng.so.1 |
| | 28 | ln -s libglpng.so.1.45 $(DESTDIR)/$(LIB)/libglpng.so |
diff -Naurb glpng-1.4.5/src/glpng.c glpng-1.4.5-haiku/src/glpng.c
|
old
|
new
|
|
| 29 | 29 | #include <GL/gl.h> |
| 30 | 30 | #include <stdlib.h> |
| 31 | 31 | #include <math.h> |
| 32 | | #include "png/png.h" |
| | 32 | #include <png.h> |
| 33 | 33 | |
| 34 | 34 | /* Used to decide if GL/gl.h supports the paletted extension */ |
| 35 | 35 | #ifdef GL_COLOR_INDEX1_EXT |
| … |
… |
|
| 269 | 269 | if (pinfo == NULL) return 0; |
| 270 | 270 | |
| 271 | 271 | fread(header, 1, 8, fp); |
| 272 | | if (!png_check_sig(header, 8)) return 0; |
| | 272 | if (png_sig_cmp(header, 0, 8)) return 0; |
| 273 | 273 | |
| 274 | 274 | png = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); |
| 275 | 275 | info = png_create_info_struct(png); |
| … |
… |
|
| 373 | 373 | png_uint_32 i; |
| 374 | 374 | |
| 375 | 375 | fread(header, 1, 8, fp); |
| 376 | | if (!png_check_sig(header, 8)) return 0; |
| | 376 | if (png_sig_cmp(header, 0, 8)) return 0; |
| 377 | 377 | |
| 378 | 378 | png = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); |
| 379 | 379 | info = png_create_info_struct(png); |