This commit is contained in:
Kelvin Sherlock 2017-01-13 00:33:06 -05:00
parent 4317d2929b
commit 61c3b82aaf
3 changed files with 21 additions and 11 deletions

View File

@ -16,6 +16,8 @@
#include "obj816.h"
#include "zrdz_disassembler.h"
#include "endian.h"
#ifndef O_BINARY
#define O_BINARY 0
#endif
@ -34,12 +36,6 @@ struct {
} flags;
enum class endian {
little = __ORDER_LITTLE_ENDIAN__,
big = __ORDER_BIG_ENDIAN__,
native = __BYTE_ORDER__
};
template<class T>
void swap_if(T &t, std::false_type) {}

17
endian.h Normal file
View File

@ -0,0 +1,17 @@
#ifndef endian_h
#define endian_h
enum class endian {
#ifdef _WIN32
little = 1234,
big = 4321,
native = little
#else
little = __ORDER_LITTLE_ENDIAN__,
big = __ORDER_BIG_ENDIAN__,
native = __BYTE_ORDER__
#endif
};
#endif

View File

@ -27,6 +27,8 @@
#include "expression.h"
#include "omf.h"
#include "endian.h"
#ifndef O_BINARY
#define O_BINARY 0
#endif
@ -44,11 +46,6 @@ struct {
uint32_t _aux_type;
} flags;
enum class endian {
little = __ORDER_LITTLE_ENDIAN__,
big = __ORDER_BIG_ENDIAN__,
native = __BYTE_ORDER__
};
template<class T>