From 15cb4ec0c0c6b2205e5d3ba0b59c09dd20b4bab5 Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Tue, 24 May 2016 14:36:07 +0100 Subject: [PATCH] Build the crypto libs as C99 Some of the crypto libs rely on UINT64_C, which in glibc 2.17 and earlier was not defined for C++ code (see https://sourceware.org/bugzilla/show_bug.cgi?id=15366). --- Makefile | 3 ++- src/{libs.cpp => libs.c} | 4 +--- 2 files changed, 3 insertions(+), 4 deletions(-) rename src/{libs.cpp => libs.c} (95%) diff --git a/Makefile b/Makefile index cbdb948..4bc6c3f 100644 --- a/Makefile +++ b/Makefile @@ -24,7 +24,8 @@ JS_PRE := $(wildcard javascript/*pre.js) JS_POST := $(wildcard javascript/*post.js) CPPFLAGS += -Iinclude -Ilib -CFLAGS += -Wall -Werror -std=c89 -fPIC +# we rely on , which was introduced in C99 +CFLAGS += -Wall -Werror -std=c99 -fPIC CXXFLAGS += -Wall -Werror -std=c++11 -fPIC LDFLAGS += -Wall -Werror diff --git a/src/libs.cpp b/src/libs.c similarity index 95% rename from src/libs.cpp rename to src/libs.c index 6757574..4304354 100644 --- a/src/libs.cpp +++ b/src/libs.c @@ -1,4 +1,4 @@ -/* Copyright 2015 OpenMarket Ltd +/* Copyright 2015-6 OpenMarket Ltd * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -12,7 +12,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -extern "C" { #include "crypto-algorithms/sha256.c" #include "crypto-algorithms/aes.c" #include "curve25519-donna/curve25519-donna.c" @@ -24,4 +23,3 @@ extern "C" { #include "ed25519/src/verify.c" #include "ed25519/src/sign.c" #include "ed25519_additions.c" -}