From de5a960adb21e4aa4857bd62ed923767ab144f86 Mon Sep 17 00:00:00 2001 From: Alexis Ballier Date: Mon, 6 Jun 2016 10:15:38 +0200 Subject: [PATCH 1/4] Drop gtest submodule and use system one. --- .gitmodules | 3 --- Makefile.am | 10 ++-------- configure.ac | 2 -- 3 files changed, 2 insertions(+), 13 deletions(-) delete mode 100644 .gitmodules diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index 48294b1..0000000 --- a/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "gtest"] - path = gtest - url = https://github.com/google/googletest.git diff --git a/Makefile.am b/Makefile.am index 8622c90..65472c7 100644 --- a/Makefile.am +++ b/Makefile.am @@ -45,12 +45,6 @@ noinst_HEADERS += \ compiler/c++.capnp.h \ compiler/test.capnp.h -GTEST_LDADD = gtest/googletest/lib/libgtest.la -gtest/googletest/lib/libgtest.la: - make -C gtest/googletest lib/libgtest.la -GTEST_CPPFLAGS = -I${srcdir}/gtest/googletest/include -DIST_SUBDIRS = gtest/googletest - check_PROGRAMS += \ capn-test capn_test_SOURCES = \ @@ -59,8 +53,8 @@ capn_test_SOURCES = \ compiler/test.capnp.c \ compiler/schema-test.cpp \ compiler/schema.capnp.c -capn_test_CPPFLAGS = $(AM_CPPFLAGS) $(GTEST_CPPFLAGS) +capn_test_CPPFLAGS = $(AM_CPPFLAGS) capn_test_CXXFLAGS = -std=gnu++11 -pthread -capn_test_LDADD = libcapnp_c.la $(GTEST_LDADD) +capn_test_LDADD = libcapnp_c.la -lgtest capn_test_LDFLAGS = -pthread TESTS = capn-test diff --git a/configure.ac b/configure.ac index ed8b799..5342cda 100755 --- a/configure.ac +++ b/configure.ac @@ -44,8 +44,6 @@ AC_SUBST(capnpdir) # AC_MSG_ERROR([capnproto base package (0.5.2 or newer) not found]) #]) -AC_CONFIG_SUBDIRS([gtest/googletest]) - AC_CONFIG_FILES([ Makefile c-capnproto.pc From c6285474b9880a121fcb901bbab09093dc56c691 Mon Sep 17 00:00:00 2001 From: Alexis Ballier Date: Mon, 6 Jun 2016 10:18:06 +0200 Subject: [PATCH 2/4] Drop gtest directory --- gtest | 1 - 1 file changed, 1 deletion(-) delete mode 160000 gtest diff --git a/gtest b/gtest deleted file mode 160000 index d225acc..0000000 --- a/gtest +++ /dev/null @@ -1 +0,0 @@ -Subproject commit d225acc90bc3a8c420a9bcd1f033033c1ccd7fe0 From de11757ac635c36429899ce9845fd545ddc3105b Mon Sep 17 00:00:00 2001 From: Alexis Ballier Date: Tue, 2 Aug 2016 15:32:01 +0200 Subject: [PATCH 3/4] Ensure capn segment is aligned properly when build with gcc too. Fixes build on 32 bits arm. --- lib/capnp_c.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/capnp_c.h b/lib/capnp_c.h index 9fa2718..2ca9298 100644 --- a/lib/capnp_c.h +++ b/lib/capnp_c.h @@ -115,7 +115,11 @@ struct capn_segment { char *data; size_t len, cap; void *user; -}; +} +#ifdef __GNUC__ +__attribute__((aligned(8))) +#endif +; enum CAPN_TYPE { CAPN_NULL = 0, From 95d81bc26dfcf5ed3a955d8be4064bc5f26a1a46 Mon Sep 17 00:00:00 2001 From: Alexis Ballier Date: Tue, 2 Aug 2016 15:35:28 +0200 Subject: [PATCH 4/4] Use proper format specifiers for size_t. --- compiler/capnpc-c.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/capnpc-c.c b/compiler/capnpc-c.c index 75b3e43..d71ca66 100644 --- a/compiler/capnpc-c.c +++ b/compiler/capnpc-c.c @@ -1354,7 +1354,7 @@ int main() { if (g_valseg.len > 8) { size_t k; - fprintf(srcf, "static const uint8_t capn_buf[%lu] = {", g_valseg.len-8); + fprintf(srcf, "static const uint8_t capn_buf[%zu] = {", g_valseg.len-8); for (k = 8; k < g_valseg.len; k++) { if (k > 8) fprintf(srcf, ","); @@ -1364,7 +1364,7 @@ int main() { } fprintf(srcf, "\n};\n"); - fprintf(srcf, "static const struct capn_segment capn_seg = {{0},0,0,0,(char*)&capn_buf[0],%lu,%lu};\n", + fprintf(srcf, "static const struct capn_segment capn_seg = {{0},0,0,0,(char*)&capn_buf[0],%zu,%zu};\n", g_valseg.len-8, g_valseg.len-8); }