true64 attempt two

This commit is contained in:
Bill Currie 2001-05-30 22:45:36 +00:00
parent cf16e6c5d7
commit 5a889df497

View file

@ -34,8 +34,9 @@
#ifndef __GNUC__ #ifndef __GNUC__
# if defined (__DECC) && defined (__ALPHA) # if defined (__DECC) && defined (__ALPHA)
# pragma nomember_alignment // uses __unaligned
# else # else
# define __unaligned
# if defined (__BORLANDC__) || defined (_MSC_VER) # if defined (__BORLANDC__) || defined (_MSC_VER)
# if (defined(__BORLANDC__) && (__BORLANDC__ < 0x550)) # if (defined(__BORLANDC__) && (__BORLANDC__ < 0x550))
# pragma option -a1 # pragma option -a1
@ -47,21 +48,23 @@
# error do some data packing magic here (#pragma pack?) # error do some data packing magic here (#pragma pack?)
# endif # endif
# endif # endif
#else
# define __unaligned
#endif #endif
typedef struct _TargaHeader { typedef struct _TargaHeader {
unsigned char id_length __attribute__((packed)); __unaligned unsigned char id_length __attribute__((packed));
unsigned char colormap_type __attribute__((packed)); __unaligned unsigned char colormap_type __attribute__((packed));
unsigned char image_type __attribute__((packed)); __unaligned unsigned char image_type __attribute__((packed));
unsigned short colormap_index __attribute__((packed)); __unaligned unsigned short colormap_index __attribute__((packed));
unsigned short colormap_length __attribute__((packed)); __unaligned unsigned short colormap_length __attribute__((packed));
unsigned char colormap_size __attribute__((packed)); __unaligned unsigned char colormap_size __attribute__((packed));
unsigned short x_origin __attribute__((packed)); __unaligned unsigned short x_origin __attribute__((packed));
unsigned short y_origin __attribute__((packed)); __unaligned unsigned short y_origin __attribute__((packed));
unsigned short width __attribute__((packed)); __unaligned unsigned short width __attribute__((packed));
unsigned short height __attribute__((packed)); __unaligned unsigned short height __attribute__((packed));
unsigned char pixel_size __attribute__((packed)); __unaligned unsigned char pixel_size __attribute__((packed));
unsigned char attributes __attribute__((packed)); __unaligned unsigned char attributes __attribute__((packed));
} TargaHeader; } TargaHeader;
#if defined (__BORLANDC__) || defined (_MSC_VER) #if defined (__BORLANDC__) || defined (_MSC_VER)
@ -70,10 +73,6 @@ typedef struct _TargaHeader {
# else # else
# pragma pack(pop, tgainclude) # pragma pack(pop, tgainclude)
# endif # endif
#else
# if defined (__DECC) && defined (__ALPHA)
# pragma member_alignment
# endif
#endif #endif
byte *LoadTGA (QFile *fin); byte *LoadTGA (QFile *fin);