amiga_imgv

diff src/image.c @ 6:ae0ada629b03

wohooo it works :)
author John Tsiombikas <nuclear@member.fsf.org>
date Fri, 27 Oct 2017 15:42:58 +0300
parents 0d3d7b020e6a
children 4c36d0f44aa6
line diff
     1.1 --- a/src/image.c	Fri Oct 27 12:32:24 2017 +0300
     1.2 +++ b/src/image.c	Fri Oct 27 15:42:58 2017 +0300
     1.3 @@ -15,13 +15,20 @@
     1.4  static uint16_t (*ntohs)(uint16_t);
     1.5  #endif
     1.6  
     1.7 +
     1.8 +#ifdef __GNUC__
     1.9 +#define PACKED	__attribute__((packed))
    1.10 +#else
    1.11 +#define PACKED
    1.12 +#endif
    1.13 +
    1.14  struct ham_image_header {
    1.15  	char magic[4];
    1.16  	uint16_t width, height;
    1.17  	unsigned char nbitplanes, padding;
    1.18  	uint16_t nchg;
    1.19  	uint16_t palette[16];
    1.20 -};
    1.21 +} PACKED;
    1.22  
    1.23  struct ham_image *load_ham_image(const char *fname)
    1.24  {