Print the word size and endianness of the host machine.

See also: Variable size/Get

/* Return wordsize to Neko */
/* From Rosetta Code, C entry, with Neko marshalling */
 
#include <stdio.h>
#include <stddef.h> /* for size_t */
#include <limits.h> /* for CHAR_BIT */
#include <neko.h>
 
value wordsize(void) {
    /*
     * Best bet: size_t typically is exactly one word.
     */
    return alloc_int((int)(CHAR_BIT * sizeof(size_t)));
}
/* Expose symbol to Neko loader */
DEFINE_PRIM(wordsize, 0);