From abbf45c1da7f3e3a542e6c6339a1bab31283f22e Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Mon, 4 Apr 2011 07:22:10 +0000 Subject: 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. --- autoconfig.cpp | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 autoconfig.cpp (limited to 'autoconfig.cpp') diff --git a/autoconfig.cpp b/autoconfig.cpp new file mode 100644 index 0000000..aa8b6a4 --- /dev/null +++ b/autoconfig.cpp @@ -0,0 +1,30 @@ +#include +#include + +void detectEndianness() +{ + uint16_t x=0x0100; + fprintf( stderr, + "#define LITTLE_ENDIAN 0\n" + "#define BIG_ENDIAN 1\n" + "#define ENDIANNESS %d\n\n", + ((uint8_t *)&x)[0] + ); + printf("Archetecture is: %s Endian\n", ((uint8_t *)&x)[0]?"Big":"Little" ); +} + +int main() +{ + fprintf( stderr, + "#ifndef BU_AUTO_CONFIG_H\n" + "#define BU_AUTO_CONFIG_H\n\n" + ); + + // huh, turns out #include covers this... +// detectEndianness(); + + fprintf( stderr, "#endif\n"); + + return 0; +} + -- cgit v1.2.3