mirror of
https://github.com/zint/zint
synced 2024-11-16 20:57:25 +13:00
pack structures in portable fashion, now creates valid bitmap headers for Windows
This commit is contained in:
parent
6dbf817ffa
commit
71a30a9031
@ -43,16 +43,14 @@ extern "C" {
|
||||
#include <stdint.h>
|
||||
#endif
|
||||
|
||||
#pragma pack (1)
|
||||
|
||||
typedef struct bitmap_file_header {
|
||||
uint16_t header_field;
|
||||
uint32_t file_size;
|
||||
uint32_t reserved;
|
||||
uint32_t data_offset;
|
||||
}
|
||||
#ifdef __GNUC__
|
||||
__attribute__((__packed__))
|
||||
#endif
|
||||
bitmap_file_header_t;
|
||||
} bitmap_file_header_t;
|
||||
|
||||
typedef struct bitmap_info_header {
|
||||
uint32_t header_size;
|
||||
@ -66,11 +64,9 @@ extern "C" {
|
||||
int32_t vert_res;
|
||||
uint32_t colours;
|
||||
uint32_t important_colours;
|
||||
}
|
||||
#ifdef __GNUC__
|
||||
__attribute__((__packed__))
|
||||
#endif
|
||||
bitmap_info_header_t;
|
||||
} bitmap_info_header_t;
|
||||
|
||||
#pragma pack ()
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
@ -43,6 +43,8 @@ extern "C" {
|
||||
#include <stdint.h>
|
||||
#endif
|
||||
|
||||
#pragma pack (1)
|
||||
|
||||
typedef struct pcx_header {
|
||||
uint8_t manufacturer;
|
||||
uint8_t version;
|
||||
@ -62,11 +64,9 @@ extern "C" {
|
||||
uint16_t horiz_screen_size;
|
||||
uint16_t vert_screen_size;
|
||||
uint8_t filler[54];
|
||||
}
|
||||
#ifdef __GNUC__
|
||||
__attribute__((__packed__ ))
|
||||
#endif
|
||||
pcx_header_t;
|
||||
} pcx_header_t;
|
||||
|
||||
#pragma pack ()
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user