mirror of
https://github.com/dropbox/json11.git
synced 2024-11-21 03:13:49 +08:00
Make test.cpp compilable with GCC.
Add clean rule to Makefile.
This commit is contained in:
parent
50ed8c90e5
commit
61ba0a1dd2
7
Makefile
7
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
|
||||
|
3
test.cpp
3
test.cpp
@ -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…
Reference in New Issue
Block a user