Christian,
I'm using the following compilers:
1) clang version 5.0.1-svn325091-1~exp1 (branches/release_50)
2) arm-linux-androideabi-gcc (Linaro GCC 4.7-2014.04-1~dev) 4.7.4
3) gcc (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609
clang and arm-linux-androideabi-gcc compiles MHD fine, but gcc raises the
following error:
[snip]
/libmicrohttpd/include/microhttpd.h:277:46: error: ISO C90 does not support
‘long long’ [-Werror=long-long]
#define MHD_UNSIGNED_LONG_LONG unsigned long long
^
/libmicrohttpd/include/microhttpd.h:2348:4: note: in expansion of macro
‘MHD_UNSIGNED_LONG_LONG’
MHD_UNSIGNED_LONG_LONG *timeout);
^
cc1: all warnings being treated as errors
I fixed it using the attached patch, but I'm not sure if it is the proper
way to fix it.
WDYT about this change?
--
Silvio Clécio
From 26ca79c3968eb1ce697af4ee6b07851bab4d0f3e Mon Sep 17 00:00:00 2001
From: silvioprog <[email protected]>
Date: Sat, 24 Mar 2018 00:15:40 -0300
Subject: [PATCH 1/1] Fix building in GCC.
---
src/include/microhttpd.h | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/include/microhttpd.h b/src/include/microhttpd.h
index cff084e..8d696e9 100644
--- a/src/include/microhttpd.h
+++ b/src/include/microhttpd.h
@@ -274,7 +274,11 @@ typedef SOCKET MHD_socket;
* @deprecated use #MHD_UNSIGNED_LONG_LONG instead!
*/
#define MHD_LONG_LONG long long
+#ifdef __GNUC__
+#define MHD_UNSIGNED_LONG_LONG uint64_t
+#else
#define MHD_UNSIGNED_LONG_LONG unsigned long long
+#endif
#else /* MHD_LONG_LONG */
_MHD_DEPR_MACRO("Macro MHD_LONG_LONG is deprecated, use MHD_UNSIGNED_LONG_LONG")
#endif
--
2.7.4