libjansson seems be clever enough to treat and integer as a long long where possible.

/* If your compiler supports the `long long` type and the strtoll()
   library function, JSON_INTEGER_IS_LONG_LONG is defined to 1,
   otherwise to 0. */
#define JSON_INTEGER_IS_LONG_LONG 1

Maybe not completely architecturally agnostic though.