aboutsummaryrefslogtreecommitdiff
path: root/include/endian.h
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2017-06-22 16:32:47 -0400
committerDrew DeVault <sir@cmpwn.com>2017-06-23 13:41:07 -0400
commit2aafb5dd19f8a3e3436f8843071fa2076a6d2716 (patch)
tree6fe60ddeb499ebad270fae0c929ef4c79188e969 /include/endian.h
parentf252c5a79214a3d3cd7ab3f239050b234e4ae9e2 (diff)
Add wlcore/wl_shm (WIP)
Diffstat (limited to 'include/endian.h')
-rw-r--r--include/endian.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/endian.h b/include/endian.h
new file mode 100644
index 00000000..0e9b6101
--- /dev/null
+++ b/include/endian.h
@@ -0,0 +1,8 @@
+#ifndef _WLR_ENDIAN_H
+#define _WLR_ENDIAN_H
+
+// https://stackoverflow.com/a/4240257
+
+#define little_endian() (((union { unsigned x; unsigned char c; }){1}).c)
+
+#endif