[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
gnunet_container_lib.h incompatible with C++ in GNUnet 0.19.0
From: |
marty1885 |
Subject: |
gnunet_container_lib.h incompatible with C++ in GNUnet 0.19.0 |
Date: |
Thu, 08 Dec 2022 16:38:26 +0000 |
Hi,
Nice for releasing GNUnet 0.19.0. I've upgraded and find my C++ programs fails
to compile against the new headers. After some debugging the root cause is a (I
assume) failed attempt at completing removing `extern "C"` guards in
`gnunet_container_lib.h`. Seems the top half of the guard is removed but the
bottom half isn't. Leading to an error when including any headers that uses
that file from C++. For example the following simple program fails to compile.
I have scanned through the GNUnet website and not sure how to contribute my
fix. The "development tutorial" page
(https://docs.gnunet.org/tutorial/tutorial.html) is broken on the website. The
website also mentioned needing to sign copyright assignment? What exactly
should I do?
#include <gnunet/gnunet_core_service.h>
int main()
{
reutrn 0;
}
Compiling with g++ leads to the following error:
❯ g++ simple.cpp
In file included from simple.cpp:1:
/usr/include/gnunet/gnunet_core_service.h:440:1: error: expected declaration
before ‘}’ token
440 | }
| ^
And following patch fixes it.
--- /usr/include/gnunet/gnunet_container_lib.h.old 2022-12-09
00:29:44.746504181 +0800
+++ /usr/include/gnunet/gnunet_container_lib.h 2022-12-09 00:29:58.554055321
+0800
@@ -2328,15 +2328,6 @@
GNUNET_CONTAINER_heap_update_cost (struct GNUNET_CONTAINER_HeapNode *node,
GNUNET_CONTAINER_HeapCostType new_cost);
-
-#if 0 /* keep Emacsens' auto-indent happy */
-{
-#endif
-#ifdef __cplusplus
-}
-#endif
-
-
/* ifndef GNUNET_CONTAINER_LIB_H */
#endif
Best,
Martin
- gnunet_container_lib.h incompatible with C++ in GNUnet 0.19.0,
marty1885 <=