this repo has no description

Test with C99 and C++11

We need va_copy which is only in C++11 and newer.

+14 -6
+13 -5
Makefile
··· 1 1 CFLAGS=-Wall -Wextra -Wpedantic 2 + CXXFLAGS=$(CFLAGS) 2 3 3 - test: tests 4 - ./tests 4 + test: tests_c tests_cpp 5 + ./tests_c 6 + ./tests_cpp 5 7 6 - tests: fmt.h tests.o 7 - $(CC) $(CFLAGS) tests.o -o tests 8 + tests_c: fmt.h tests.c 9 + $(CC) -std=c99 $(CFLAGS) tests.c -o tests_c 10 + 11 + tests_cpp: fmt.h tests.c 12 + $(CXX) -std=c++11 $(CXXFLAGS) tests.c -o tests_cpp 8 13 9 14 format: 10 15 clang-format -i fmt.h tests.c 11 16 12 - .PHONY: test format 17 + clean: 18 + rm tests_c tests_cpp 19 + 20 + .PHONY: test format clean
+1 -1
fmt.h
··· 22 22 } 23 23 result.length = (size_t)size; 24 24 // +1 to include NUL 25 - result.str = malloc(size + 1); 25 + result.str = (char *)malloc(size + 1); 26 26 if (result.str == NULL) { 27 27 return result; 28 28 }