diff options
Diffstat (limited to 'src/internal/perk_endian_impl.h')
-rw-r--r-- | src/internal/perk_endian_impl.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/internal/perk_endian_impl.h b/src/internal/perk_endian_impl.h new file mode 100644 index 0000000..030dfa9 --- /dev/null +++ b/src/internal/perk_endian_impl.h @@ -0,0 +1,20 @@ +/***************************************************************/ +/* perk: PE Resource Kit */ +/* Copyright (C) 2015--2016 Z. Gilboa */ +/* Released under GPLv2 and GPLv3; see COPYING.PERK. */ +/***************************************************************/ + +#ifndef PERK_ENDIAN_IMPL_H +#define PERK_ENDIAN_IMPL_H + +#include <stdbool.h> + +#define PERK_LITTLE_ENDIAN pe_little_endian_host() + +static inline bool pe_little_endian_host(void) +{ + const long test = 1; + return *((char *)&test); +} + +#endif |