summaryrefslogtreecommitdiffhomepage
path: root/src/internal/perk_endian_impl.h
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2016-05-06 08:55:29 -0400
committermidipix <writeonce@midipix.org>2016-11-10 23:35:43 -0500
commit8216f99bc4dfeb9dc079694e528566b8bf89438f (patch)
tree3f4590e3a21e8514d48b51b1718d33ff53db4c96 /src/internal/perk_endian_impl.h
parent60f46a42ac0b7e87a53e7cdd84186449abca2117 (diff)
downloadperk-8216f99bc4dfeb9dc079694e528566b8bf89438f.tar.bz2
perk-8216f99bc4dfeb9dc079694e528566b8bf89438f.tar.xz
internals: pe_little_endian_host(): initial implementation and integration.
Diffstat (limited to 'src/internal/perk_endian_impl.h')
-rw-r--r--src/internal/perk_endian_impl.h20
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