mirror of
https://github.com/kgabis/parson.git
synced 2025-02-05 08:55:30 +00:00
parson should compile with c++ compilers (again).
This commit is contained in:
parent
86a5a20856
commit
849f00728b
14
Makefile
14
Makefile
@ -1,12 +1,20 @@
|
||||
CC = gcc
|
||||
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
|
||||
$(CC) $(CFLAGS) -o $@ tests.c parson.c
|
||||
./$@
|
||||
|
||||
testcpp: tests.c parson.c
|
||||
$(CPPC) $(CPPFLAGS) -o $@ tests.c parson.c
|
||||
./$@
|
||||
|
||||
clean:
|
||||
rm -f test *.o
|
||||
rm -f test *.o
|
||||
|
||||
|
2
parson.c
2
parson.c
@ -404,7 +404,7 @@ static JSON_Status json_array_resize(JSON_Array *array, size_t new_capacity) {
|
||||
if (new_capacity == 0) {
|
||||
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) {
|
||||
return JSONFailure;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user