Fix support for building without MPW_JSON enabled.
This commit is contained in:
		@@ -20,7 +20,9 @@
 | 
			
		||||
#define _MPW_MARSHALL_UTIL_H
 | 
			
		||||
 | 
			
		||||
#include <time.h>
 | 
			
		||||
#if MPW_JSON
 | 
			
		||||
#include "json-c/json.h"
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#include "mpw-algorithm.h"
 | 
			
		||||
 | 
			
		||||
@@ -37,6 +39,7 @@ time_t mpw_mktime(
 | 
			
		||||
 | 
			
		||||
/// JSON parsing.
 | 
			
		||||
 | 
			
		||||
#if MPW_JSON
 | 
			
		||||
/** Search for a JSON child object in a JSON object tree.
 | 
			
		||||
  * @param section A dot-delimited list of JSON object keys to walk toward the child object.
 | 
			
		||||
  * @return A new JSON object or NULL if one of the section's object keys was not found in the source object's tree. */
 | 
			
		||||
@@ -57,6 +60,7 @@ int64_t mpw_get_json_int(
 | 
			
		||||
  * @return The boolean value or defaultValue if one of the section's object keys was not found in the source object's tree. */
 | 
			
		||||
bool mpw_get_json_boolean(
 | 
			
		||||
        json_object *obj, const char *section, bool defaultValue);
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/// mpw.
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -33,7 +33,11 @@ typedef mpw_enum( unsigned int, MPMarshallFormat ) {
 | 
			
		||||
    /** Generate a name for identification. */
 | 
			
		||||
            MPMarshallFormatJSON,
 | 
			
		||||
 | 
			
		||||
#if MPW_JSON
 | 
			
		||||
    MPMarshallFormatDefault = MPMarshallFormatJSON,
 | 
			
		||||
#else
 | 
			
		||||
    MPMarshallFormatDefault = MPMarshallFormatFlat,
 | 
			
		||||
#endif
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
typedef mpw_enum( unsigned int, MPMarshallErrorType ) {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user