Mail Archives: djgpp/1996/01/22/18:11:33
Fulco Bohle (100662 DOT 3563 AT compuserve DOT com) wrote:
: #pragma pack(4) /* initiates 4-bytes alignment */
:
: typedef struct
: {
: char aap; /* dutch for monkey */
: int noot; /* dutch for nut */
: } s_leesplankje; /* this is how I learned to read */
:
: sizeof (s_leesplankje) = max( sizeof( char), 4) + sizeof( int)
:
: #pragma pack(2) /* initiates 2-bytes alignment */
:
: typedef struct
: {
: char aap;
: int noot;
: } s_leesplankje;
:
: sizeof (s_leesplankje) = max( sizeof( char), 2) + sizeof( int)
:
: How do I obtain the same results in DGGPP-C
The gcc compiler does not like #pragma's, because it is difficult, if not
impossible to make the code portable. This is the solutions:
/* #pragma pack(4) */
typedef struct {
char monkey; /* Takes full 4 bytes. */
int nut;
} mystruct1;
/* #pragma pack(2) */
#define PACKED __attribute__ ((packed))
typedef struct {
char monkey PACKED;
char pad1 PACKED;
int nut PACKED;
} mystruct2;
: 2. Does DJGPP-C understand based pointers ?
What is a based pointer?
: 3. What is the main difference between djgpp verion 1.12 and 2.0 ?
Main differences are the evolution from 'go32' to use external DPMI
extenders. (Along with a couple of fixups and general improvements, of
course.)
: Fulco Bohle
:
----------------------------------------------------------------------
| P†l-Kristian Engstad | engstad AT funcom DOT com | Games programmer, PSX |
| Funcom Productions | Ph +47 22 42 01 02 | developer & Linux Fan |
----------------------------------------------------------------------
- Raw text -