view endianchk.c @ 101:9d4d1783800b

Add si_sldb_{read,write}_bin() functions to write and read a binary format SLDB database, which is faster than parsing Songlengths.txt.
author Matti Hamalainen <ccr@tnsp.org>
date Mon, 15 Feb 2016 01:20:37 +0200
parents 8e7e08bf7b9e
children 9a0aeb9ce9ba
line wrap: on
line source

#include <stdio.h>

int main(int argc, char *argv[])
{
    int val = 1, ret;
    char *s = (char *) &val;
    (void) argc;
    (void) argv;
    ret = (int)(*s);
    printf(
        "#ifndef MY_CONFIG_H\n"
        "#define MY_CONFIG_H 1\n"
        "\n"
        "#define TH_BYTEORDER TH_%s_ENDIAN\n"
        "\n"
        "#endif /* MY_CONFIG_H */\n"
        ,
        ret ? "LITTLE" : "BIG"
        );
    return 0;
}