summaryrefslogtreecommitdiff
path: root/include/test_BITFIELDS_HTOL.c
diff options
context:
space:
mode:
authorIgor Pashev <pashev.igor@gmail.com>2012-12-31 05:04:42 +0400
committerIgor Pashev <pashev.igor@gmail.com>2012-12-31 05:04:42 +0400
commit71dc8760ff4de5f365330d1bc571d934deb54af9 (patch)
tree7346d42a282562a3937d82307012b5857d642ce6 /include/test_BITFIELDS_HTOL.c
downloadcdrkit-upstream.tar.gz
Imported Upstream version 1.1.11upstream/1.1.11upstream
Diffstat (limited to 'include/test_BITFIELDS_HTOL.c')
-rw-r--r--include/test_BITFIELDS_HTOL.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/include/test_BITFIELDS_HTOL.c b/include/test_BITFIELDS_HTOL.c
new file mode 100644
index 0000000..674c457
--- /dev/null
+++ b/include/test_BITFIELDS_HTOL.c
@@ -0,0 +1,23 @@
+/*
+ * This file has been modified for the cdrkit suite.
+ *
+ * The behaviour and appearence of the program code below can differ to a major
+ * extent from the version distributed by the original author(s).
+ *
+ * For details, see Changelog file distributed with the cdrkit package. If you
+ * received this file from another source then ask the distributing person for
+ * a log of modifications.
+ *
+ */
+
+/* test_BITFIELD_HTOL.c derived from cdrtools aclocal.m4 by Joerg Schilling */
+/* Return 1 if bitfields are high-to-low, 0 if bitfields are low-to-high */
+int main()
+{
+ union {
+ unsigned char ch;
+ struct { unsigned char bf1:4, bf2:4; } bf;
+ } u;
+ u.ch = 0x12;
+ return (u.bf.bf1 == 1);
+}