diff --git a/include/dos_inc.h b/include/dos_inc.h index e644b505..f042f781 100644 --- a/include/dos_inc.h +++ b/include/dos_inc.h @@ -24,7 +24,7 @@ #if defined (_MSC_VER) #pragma pack(1) -#endif# +#endif struct CommandTail{ Bit8u count; /* number of bytes returned */ char buffer[127]; /* the buffer itself */ diff --git a/include/dos_system.h b/include/dos_system.h index 02828782..0b240d03 100644 --- a/include/dos_system.h +++ b/include/dos_system.h @@ -35,7 +35,9 @@ enum { DOS_ATTR_ARCHIVE= 0x20 }; -#pragma pack (1) +#if defined (_MSC_VER) +#pragma pack(1) +#endif struct DTA_FindBlock { Bit8u sdrive; /* The Drive the search is taking place */ Bit16u sattr; /* The attributes that need to be found */ @@ -45,8 +47,13 @@ struct DTA_FindBlock { Bit16u date; Bit32u size; char name[DOS_NAMELENGTH]; -}; -#pragma pack () +} +#if defined (_MSC_VER) +; +#pragma pack() +#else +__attribute__ ((packed)); +#endif class DOS_File { public: diff --git a/src/dos/dos_execute.cpp b/src/dos/dos_execute.cpp index fd3fb54b..ee315240 100644 --- a/src/dos/dos_execute.cpp +++ b/src/dos/dos_execute.cpp @@ -21,8 +21,9 @@ #include "mem.h" #include "dos_inc.h" #include "cpu.h" +#if defined (_MSC_VER) #pragma pack(1) - +#endif struct EXE_Header { @@ -40,8 +41,13 @@ struct EXE_Header { Bit16u initCS; Bit16u reloctable; Bit16u overlay; -}; +} +#if defined (_MSC_VER) +; #pragma pack() +#else +__attribute__ ((packed)); +#endif #define MAGIC1 0x5a4d #define MAGIC2 0x4d5a diff --git a/src/dos/dos_tables.cpp b/src/dos/dos_tables.cpp index a2b2fced..2318655d 100644 --- a/src/dos/dos_tables.cpp +++ b/src/dos/dos_tables.cpp @@ -20,13 +20,19 @@ #include "mem.h" #include "dos_inc.h" +#if defined (_MSC_VER) #pragma pack(1) - +#endif struct DOS_TableCase { Bit16u size; Bit8u chars[256]; -}; +} +#if defined (_MSC_VER) +; #pragma pack() +#else +__attribute__ ((packed)); +#endif RealPt DOS_TableUpCase; diff --git a/src/ints/int10_misc.cpp b/src/ints/int10_misc.cpp index 5dbfd81f..98e62848 100644 --- a/src/ints/int10_misc.cpp +++ b/src/ints/int10_misc.cpp @@ -23,7 +23,9 @@ +#if defined (_MSC_VER) #pragma pack(1) +#endif struct Dynamic_Functionality { RealPt static_table; /* 00h DWORD address of static functionality table */ Bit8u cur_mode; /* 04h BYTE video mode in effect */ @@ -68,9 +70,13 @@ struct Dynamic_Functionality { 7 reserved */ Bit8u reserved2[13]; /* 33h 13 BYTEs reserved (00h) */ -}; +} +#if defined (_MSC_VER) +; #pragma pack() - +#else +__attribute__ ((packed)); +#endif