pack structures in portable fashion, now creates valid bitmap headers for Windows

This commit is contained in:
Robin Stuart 2016-09-10 18:35:45 +01:00
parent 6dbf817ffa
commit 71a30a9031
2 changed files with 18 additions and 22 deletions

View file

@ -36,13 +36,15 @@
extern "C" {
#endif
#ifdef _MSC_VER
#include <windows.h>
#include "stdint_msvc.h"
#else
#include <stdint.h>
#endif
#ifdef _MSC_VER
#include <windows.h>
#include "stdint_msvc.h"
#else
#include <stdint.h>
#endif
#pragma pack (1)
typedef struct pcx_header {
uint8_t manufacturer;
uint8_t version;
@ -62,12 +64,10 @@ 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
}
#endif