summaryrefslogtreecommitdiff
path: root/autoconfig.cpp
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2011-04-04 07:22:10 +0000
committerMike Buland <eichlan@xagasoft.com>2011-04-04 07:22:10 +0000
commitabbf45c1da7f3e3a542e6c6339a1bab31283f22e (patch)
tree1d40f79bbe315294507bb9bfedfbe2b01e815c1a /autoconfig.cpp
parentbc5fc82538f220f62f231d5bdda5910752156a32 (diff)
downloadlibbu++-abbf45c1da7f3e3a542e6c6339a1bab31283f22e.tar.gz
libbu++-abbf45c1da7f3e3a542e6c6339a1bab31283f22e.tar.bz2
libbu++-abbf45c1da7f3e3a542e6c6339a1bab31283f22e.tar.xz
libbu++-abbf45c1da7f3e3a542e6c6339a1bab31283f22e.zip
I made some awesome progress on the UtfString system, it stores in native utf16
encoding to make things easier (little endian in our case). It can currently read utf8 and utf16be, but not BOM. It will give you full unicode code points instead of the raw utf16 values, which is pretty slick.
Diffstat (limited to 'autoconfig.cpp')
-rw-r--r--autoconfig.cpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/autoconfig.cpp b/autoconfig.cpp
new file mode 100644
index 0000000..aa8b6a4
--- /dev/null
+++ b/autoconfig.cpp
@@ -0,0 +1,30 @@
1#include <stdint.h>
2#include <stdio.h>
3
4void detectEndianness()
5{
6 uint16_t x=0x0100;
7 fprintf( stderr,
8 "#define LITTLE_ENDIAN 0\n"
9 "#define BIG_ENDIAN 1\n"
10 "#define ENDIANNESS %d\n\n",
11 ((uint8_t *)&x)[0]
12 );
13 printf("Archetecture is: %s Endian\n", ((uint8_t *)&x)[0]?"Big":"Little" );
14}
15
16int main()
17{
18 fprintf( stderr,
19 "#ifndef BU_AUTO_CONFIG_H\n"
20 "#define BU_AUTO_CONFIG_H\n\n"
21 );
22
23 // huh, turns out #include <endian.h> covers this...
24// detectEndianness();
25
26 fprintf( stderr, "#endif\n");
27
28 return 0;
29}
30