diff --git a/Makefile b/Makefile index f251c1f..5a6adc6 100644 --- a/Makefile +++ b/Makefile @@ -1,2 +1,7 @@ test: json11.cpp json11.hpp test.cpp - clang++ -O -std=c++11 -stdlib=libc++ json11.cpp test.cpp -o test -fno-rtti -fno-exceptions + $(CXX) -O -std=c++11 json11.cpp test.cpp -o test -fno-rtti -fno-exceptions + +clean: + if [ -e test ]; then rm test; fi + +.PHONY: clean diff --git a/test.cpp b/test.cpp index f3c3301..f6fb547 100644 --- a/test.cpp +++ b/test.cpp @@ -1,5 +1,6 @@ #include #include +#include #include #include #include "json11.hpp" @@ -89,7 +90,7 @@ int main(int argc, char **argv) { Json uni = Json::parse(unicode_escape_test, err); assert(uni[0].string_value().size() == (sizeof utf8) - 1); - assert(memcmp(uni[0].string_value().data(), utf8, sizeof utf8) == 0); + assert(std::memcmp(uni[0].string_value().data(), utf8, sizeof utf8) == 0); // Demonstrates the behavior change in Xcode 7 / Clang 3.7 described // here: https://llvm.org/bugs/show_bug.cgi?id=23812