Re: Nokia n900 and Euphoria
- Posted by Jerome May 25, 2011
- 5194 views
SDPringle said...
So the idea is to use
#if ARCH == ARM // ARM code #endif #if ARCH == ix86 // Intel x86 code #endif
I might be off base, but I think c preprocessor comparasions can only work with integers. Take the following the example:
#include <stdio.h> int main() { #if ARCH == ARM printf("Arch is ARM \n"); #else printf("Arch is something else \n") #endif return 0; }
Compiling and running with:
1) gcc -DARCH=x86 test.c -o test outputs "Arch is ARM"
2) gcc -DARCH=ARM test.c -o test outputs "Arch is ARM"
The code works as expected with the following:
#include <stdio.h> int main() { #if ARCH == 1 printf("Arch is ARM \n"); #else printf("Arch is something else \n") #endif return 0; }
1) gcc -DARCH=1 test.c -o test outputs "Arch is ARM"
2) gcc -DARCH=0 test.c -o test outputs "Arch is something else"
Thanks,
Ira