Support building with OpenWatcom 1.8. Silence some compiler warnings.

This commit is contained in:
Markus F.X.J. Oberhumer
2008-12-31 16:56:38 +01:00
parent 063bd58802
commit 25f1765f36
27 changed files with 219 additions and 257 deletions
+18 -36
View File
@@ -52,8 +52,7 @@ struct ElfITypes
// The ELF file header. This appears at the start of every ELF file.
template <class TElfITypes>
struct Ehdr
{
__packed_struct(Ehdr)
typedef typename TElfITypes::Half Half;
typedef typename TElfITypes::Word Word;
typedef typename TElfITypes::Addr Addr;
@@ -76,13 +75,11 @@ struct Ehdr
# define WANT_EHDR_ENUM 1
# include "p_elf_enum.h"
}
__attribute_packed;
__packed_struct_end()
template <class TElfITypes>
struct Dyn
{
__packed_struct(Dyn)
typedef typename TElfITypes::Xword Xword;
typedef typename TElfITypes::Addr Addr;
@@ -91,13 +88,11 @@ struct Dyn
# define WANT_DYN_ENUM 1
# include "p_elf_enum.h"
}
__attribute_packed;
__packed_struct_end()
template <class TElfITypes>
struct External_Note
{
__packed_struct(External_Note)
typedef typename TElfITypes::Word Word;
Word xn_namesz; // includes terminating '\0'
@@ -105,8 +100,7 @@ struct External_Note
Word xn_type;
//char xn_name[N]; // terminate with '\0'
//char xn_data[M]; // aligned to 0 mod 4
}
__attribute_packed;
__packed_struct_end()
} // namespace N_Elf
@@ -119,8 +113,7 @@ __attribute_packed;
namespace N_Elf32 {
template <class TElfITypes>
struct Phdr
{
__packed_struct(Phdr)
typedef typename TElfITypes::Word Word;
typedef typename TElfITypes::Addr Addr;
typedef typename TElfITypes::Off Off;
@@ -136,13 +129,11 @@ struct Phdr
# define WANT_PHDR_ENUM 1
# include "p_elf_enum.h"
}
__attribute_packed;
__packed_struct_end()
template <class TElfITypes>
struct Shdr
{
__packed_struct(Shdr)
typedef typename TElfITypes::Word Word;
typedef typename TElfITypes::Addr Addr;
typedef typename TElfITypes::Off Off;
@@ -160,13 +151,11 @@ struct Shdr
# define WANT_SHDR_ENUM 1
# include "p_elf_enum.h"
}
__attribute_packed;
__packed_struct_end()
template <class TElfITypes>
struct Sym
{
__packed_struct(Sym)
typedef typename TElfITypes::Word Word;
typedef typename TElfITypes::Addr Addr;
typedef typename TElfITypes::Section Section;
@@ -184,8 +173,7 @@ struct Sym
static unsigned int get_st_bind(unsigned x) { return 0xf & (x>>4); }
static unsigned int get_st_type(unsigned x) { return 0xf & x ; }
static unsigned char make_st_info(unsigned bind, unsigned type) { return (bind<<4) + (0xf & type); }
}
__attribute_packed;
__packed_struct_end()
} // namespace N_Elf32
@@ -198,8 +186,7 @@ __attribute_packed;
namespace N_Elf64 {
template <class TElfITypes>
struct Phdr
{
__packed_struct(Phdr)
typedef typename TElfITypes::Word Word;
typedef typename TElfITypes::Xword Xword;
typedef typename TElfITypes::Addr Addr;
@@ -216,13 +203,11 @@ struct Phdr
# define WANT_PHDR_ENUM 1
# include "p_elf_enum.h"
}
__attribute_packed;
__packed_struct_end()
template <class TElfITypes>
struct Shdr
{
__packed_struct(Shdr)
typedef typename TElfITypes::Word Word;
typedef typename TElfITypes::Xword Xword;
typedef typename TElfITypes::Addr Addr;
@@ -241,13 +226,11 @@ struct Shdr
# define WANT_SHDR_ENUM 1
# include "p_elf_enum.h"
}
__attribute_packed;
__packed_struct_end()
template <class TElfITypes>
struct Sym
{
__packed_struct(Sym)
typedef typename TElfITypes::Word Word;
typedef typename TElfITypes::Xword Xword;
typedef typename TElfITypes::Addr Addr;
@@ -266,8 +249,7 @@ struct Sym
static unsigned int get_st_bind(unsigned x) { return 0xf & (x>>4); }
static unsigned int get_st_type(unsigned x) { return 0xf & x ; }
static unsigned char make_st_info(unsigned bind, unsigned type) { return (bind<<4) + (0xf & type); }
}
__attribute_packed;
__packed_struct_end()
} // namespace N_Elf64