fix linux build

This commit is contained in:
Alex Fabijanic 2017-09-27 13:03:29 -05:00
parent 1054c46f6c
commit fab661a4a3
5 changed files with 20 additions and 4 deletions

View File

@ -13,7 +13,7 @@ objects = ArchiveStrategy Ascii ASCIIEncoding AsyncChannel \
Debugger DeflatingStream DigestEngine DigestStream DirectoryIterator DirectoryWatcher \
Environment Event EventChannel Error EventArgs ErrorHandler Exception FIFOBufferStream FPEnvironment File \
FileChannel Formatter FormattingChannel Glob HexBinaryDecoder LineEndingConverter \
HexBinaryEncoder InflatingStream Latin1Encoding Latin2Encoding Latin9Encoding LogFile \
HexBinaryEncoder InflatingStream JSONString Latin1Encoding Latin2Encoding Latin9Encoding LogFile \
Logger LoggingFactory LoggingRegistry LogStream NamedEvent NamedMutex NullChannel \
MemoryPool MD4Engine MD5Engine Manifest Message Mutex \
NestedDiagnosticContext Notification NotificationCenter \

View File

@ -3,6 +3,10 @@
#include <stdio.h>
#if defined(__cplusplus) && !defined(POCO_OS_FAMILY_WINDOWS)
extern "C" {
#endif
enum json_type {
JSON_ERROR = 1, JSON_DONE,
JSON_OBJECT, JSON_OBJECT_END, JSON_ARRAY, JSON_ARRAY_END,
@ -39,4 +43,8 @@ size_t json_get_position(json_stream *json);
size_t json_get_depth(json_stream *json);
const char *json_get_error(json_stream *json);
#if defined(__cplusplus) && !defined(POCO_OS_FAMILY_WINDOWS)
}
#endif
#endif

View File

@ -6,6 +6,10 @@
#endif // __STDC_VERSION__
#include <stdio.h>
#if defined(__cplusplus) && !defined(POCO_OS_FAMILY_WINDOWS)
extern "C" {
#endif
struct json_source {
int (*get) (struct json_source *);
int (*peek) (struct json_source *);
@ -49,4 +53,8 @@ struct json_stream {
char errmsg[128];
};
#if defined(__cplusplus) && !defined(POCO_OS_FAMILY_WINDOWS)
}
#endif
#endif

View File

@ -109,7 +109,7 @@ static void init(json_stream *json)
json->error = 0;
json->errmsg[0] = '\0';
json->ntokens = 0;
json->next = (json_type) 0;
json->next = (enum json_type) 0;
json->streaming = true;
json->stack = NULL;
@ -654,7 +654,7 @@ enum json_type json_next(json_stream *json)
return JSON_ERROR;
if (json->next != 0) {
enum json_type next = json->next;
json->next = (json_type) 0;
json->next = (enum json_type) 0;
return next;
}
if (json->ntokens > 0 && json->stack_top == (size_t)-1) {

View File

@ -1083,7 +1083,7 @@ void JSONTest::testSetArrayElement()
assert(dynArray[1] == 13);
assert(dynArray[2] == "foo");
#endif POCO_ENABLE_CPP11
#endif // POCO_ENABLE_CPP11
dynArray.clear();
assert(dynArray.size() == 0);