I'm trying to compile libjson with this option:
#define JSON_INT_TYPE long long
I'm using Visual Studio 2010 Express and get error c1017 in this line:
#if (JSON_INT_TYPE == long long) && defined(JSON_ISO_STRICT)
in file JSONDefs.h
Of course I do not have JSON_ISO_STRICT defined.
When I remove that check and just let the compiler define json_int_t as long long:
typedef JSON_INT_TYPE json_int_t;
I get more errors, because in JSONNode.h as_int is declared like this:
long as_int(void) const json_nothrow json_read_priority;
Having replaced that with
json_int_t as_int(void) const json_nothrow json_read_priority;
I can finally compile the library.
Can I expect this to work correctly now with numbers bigger than what long can store?
I'm going to test this now…
I see, that was an oversight, the JSONNode declaration should match the implementation, which uses json_int_t. I will fix it and release a new version shortly.
What error did VC++ give you for #if (JSON_INT_TYPE == long long) && defined(JSON_ISO_STRICT)? That's perfectly valid C++ code.
It gave me this error:
...\libjson\source\jsondefs.h(119): fatal error C1017: Ungültiger Ausdruck für Ganzzahlkonstante
Sorry for the German error text. Here's a description page in english: http://msdn.microsoft.com/en-us/library/h5sh3k99%28v=VS.100%29.aspx
Hmm, I was unaware of that limitation in the preprocessor, I will make that a g++ only error.