From 88a5a95b63f6f356f45dbf6e691ffaba5c80367b Mon Sep 17 00:00:00 2001 From: "Kenneth M. Elf Sternberg" Date: Fri, 22 Jul 2016 17:10:01 -0700 Subject: [PATCH] Added clang compatibility. --- Makefile | 4 +++- src/cheapgmp.hpp | 1 + src/compat.hpp | 6 ++++++ 3 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 src/compat.hpp diff --git a/Makefile b/Makefile index 460a889..5bd330f 100644 --- a/Makefile +++ b/Makefile @@ -5,7 +5,9 @@ CMDSRC= src/cmd.cpp TESTSOURCES= tests/test_cheapgmp.cpp LDFLAGS= TESTLDFLAGS= -laeryn_tests -laeryn_core -CFLAGS= -c -Wall -std=c++11 + +# Enable __USE_MISC if you're using clang +CFLAGS= -c -Wall -std=c++11 # -D__USE_MISC CPLUSPLUS= g++ BINARY=cheapgmp CMD=gmpcmd diff --git a/src/cheapgmp.hpp b/src/cheapgmp.hpp index 16f8c4f..fed64f1 100644 --- a/src/cheapgmp.hpp +++ b/src/cheapgmp.hpp @@ -1,3 +1,4 @@ +#include "compat.hpp" #include #include #include diff --git a/src/compat.hpp b/src/compat.hpp new file mode 100644 index 0000000..63e65cf --- /dev/null +++ b/src/compat.hpp @@ -0,0 +1,6 @@ +#ifdef __USE_MISC +/* Old compatibility names for C types. */ +typedef unsigned long int ulong; +typedef unsigned short int ushort; +typedef unsigned int uint; +#endif