mirror of
https://github.com/ksherlock/wdc-utils.git
synced 2024-12-12 04:29:05 +00:00
endian.h
This commit is contained in:
parent
4317d2929b
commit
61c3b82aaf
@ -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
17
endian.h
Normal 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
|
7
link.cpp
7
link.cpp
@ -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>
|
||||
|
Loading…
Reference in New Issue
Block a user