parson should compile with c++ compilers (again).

This commit is contained in:
Krzysztof Gabis 2015-10-05 08:37:25 +01:00
parent 86a5a20856
commit 849f00728b
2 changed files with 12 additions and 4 deletions

View File

@ -1,12 +1,20 @@
CC = gcc CC = gcc
CFLAGS = -O0 -g -Wall -Wextra -std=c89 -pedantic-errors CFLAGS = -O0 -g -Wall -Wextra -std=c89 -pedantic-errors
all: test CPPC = g++
CPPFLAGS = -O0 -g -Wall -Wextra
.PHONY: test all: test testcpp
.PHONY: test testcpp
test: tests.c parson.c test: tests.c parson.c
$(CC) $(CFLAGS) -o $@ tests.c parson.c $(CC) $(CFLAGS) -o $@ tests.c parson.c
./$@ ./$@
testcpp: tests.c parson.c
$(CPPC) $(CPPFLAGS) -o $@ tests.c parson.c
./$@
clean: clean:
rm -f test *.o rm -f test *.o

View File

@ -404,7 +404,7 @@ static JSON_Status json_array_resize(JSON_Array *array, size_t new_capacity) {
if (new_capacity == 0) { if (new_capacity == 0) {
return JSONFailure; return JSONFailure;
} }
new_items = parson_malloc(new_capacity * sizeof(JSON_Value*)); new_items = (JSON_Value**)parson_malloc(new_capacity * sizeof(JSON_Value*));
if (new_items == NULL) { if (new_items == NULL) {
return JSONFailure; return JSONFailure;
} }