Make test.cpp compilable with GCC.

Add clean rule to Makefile.
master
Andrew Twyman 8 years ago
parent 50ed8c90e5
commit 61ba0a1dd2
  1. 7
      Makefile
  2. 3
      test.cpp

@ -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

@ -1,5 +1,6 @@
#include <string>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <sstream>
#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

Loading…
Cancel
Save