-#else
-
-#define SWAPQUAD(x) 0
-
-#endif
-
- if ((fread(&magic, 1, sizeof(QUAD), fp) != sizeof(QUAD)) ||
- SWAPQUAD(magic) ||
- (magic != 0xcac0cac0) ||
- (fread(&neighborhood, 1, sizeof(QUAD), fp) != sizeof(QUAD)) ||
- SWAPQUAD(neighborhood) ||
- (fread(&rule_size, 1, sizeof(QUAD), fp) != sizeof(QUAD)) ||
- SWAPQUAD(rule_size) ||
- ((rule = (Byte *)malloc(rule_size)) == NULL) ||
- (fread(rule, 1, rule_size, fp) != rule_size)) {
- fprintf(stderr, "cam: Bad rule file \"%s\"\n", filename);
- fclose(fp);
- return;
+/* XXX: Make this byte order independent!!! */
+ if ((*(unsigned char*) (&test))) {
+ if ((fread(&magic, 1, sizeof(QUAD), fp) != sizeof(QUAD)) ||
+ SWAPQUAD(magic) ||
+ (magic != 0xcac0cac0) ||
+ (fread(&neighborhood, 1, sizeof(QUAD), fp) != sizeof(QUAD)) ||
+ SWAPQUAD(neighborhood) ||
+ (fread(&rule_size, 1, sizeof(QUAD), fp) != sizeof(QUAD)) ||
+ SWAPQUAD(rule_size) ||
+ ((rule = (Byte *)malloc(rule_size)) == NULL) ||
+ (fread(rule, 1, rule_size, fp) != rule_size)) {
+ fprintf(stderr, "cam: Bad rule file \"%s\"\n", filename);
+ fclose(fp);
+ return;
+ }
+ } else {
+ if ((fread(&magic, 1, sizeof(QUAD), fp) != sizeof(QUAD)) ||
+ (magic != 0xcac0cac0) ||
+ (fread(&neighborhood, 1, sizeof(QUAD), fp) != sizeof(QUAD)) ||
+ (fread(&rule_size, 1, sizeof(QUAD), fp) != sizeof(QUAD)) ||
+ ((rule = (Byte *)malloc(rule_size)) == NULL) ||
+ (fread(rule, 1, rule_size, fp) != rule_size)) {
+ fprintf(stderr, "cam: Bad rule file \"%s\"\n", filename);
+ fclose(fp);
+ return;
+ }