clang compile

This commit is contained in:
Alex Fabijanic 2018-01-31 19:34:43 -06:00
parent e143bdce35
commit 66f122b35f
3 changed files with 15 additions and 3 deletions

View File

@ -13,7 +13,9 @@ POCO_SOURCES_AUTO( SRCS ${SRCS_G})
file(GLOB_RECURSE HDRS_G "include/*.h" )
POCO_HEADERS_AUTO( SRCS ${HDRS_G})
POCO_SOURCES(SRCS pdjson src/pdjson.c)
SET_SOURCE_FILES_PROPERTIES(src/pdjson.c PROPERTIES LANGUAGE CXX)
if(WIN32)
SET_SOURCE_FILES_PROPERTIES(src/pdjson.c PROPERTIES LANGUAGE CXX)
endif()
add_library( "${LIBNAME}" ${LIB_MODE} ${SRCS} )
add_library( "${POCO_LIBNAME}" ALIAS "${LIBNAME}")

View File

@ -8,6 +8,7 @@
#define JSON_FLAG_ERROR (1u << 0)
#define JSON_FLAG_STREAMING (1u << 1)
// patched for poco 1.8.x (VS 2008)
#if defined(_MSC_VER) && (_MSC_VER < 1900)

View File

@ -6,11 +6,20 @@ extern "C" {
#endif // __cplusplus
#include <stdio.h>
#if !defined(_MSC_VER) // for poco 1.8.x we must compile as C++
#if !defined(__cplusplus) && !defined(_MSC_VER) // for poco 1.8.x we must compile as C++
#if defined(__STDC_VERSION__) || (__STDC_VERSION__ >= 199901L)
#include <stdbool.h>
#else
typedef enum { false, true } bool;
#ifndef bool
#define bool int
#endif
#ifndef true
#define true 1
#endif
#ifndef false
#define false 0
#endif
#endif // __STDC_VERSION__
#endif