* libnftables: build fixes
@ 2013-10-20 14:29 Jan Engelhardt
2013-10-20 14:29 ` [PATCH 1/2] build: resolve automake 1.12 warning Jan Engelhardt
2013-10-20 14:29 ` [PATCH 2/2] build: resolve build errors in dependent programs Jan Engelhardt
0 siblings, 2 replies; 5+ messages in thread
From: Jan Engelhardt @ 2013-10-20 14:29 UTC (permalink / raw)
To: netfilter-devel; +Cc: pablo
The following changes since commit ec4b60bebcab23d46aa09bed06018457c35e5afa:
src: json: remove spaces (2013-10-17 10:03:37 +0200)
are available in the git repository at:
git://git.inai.de/libnftables master
for you to fetch changes up to 2952864a0bd3b074c322862fd4dbc792fb620818:
build: resolve build errors in dependent programs (2013-10-20 16:28:55 +0200)
----------------------------------------------------------------
Jan Engelhardt (2):
build: resolve automake 1.12 warning
build: resolve build errors in dependent programs
configure.ac | 1 +
include/libnftables/chain.h | 10 ++++++++--
include/libnftables/expr.h | 10 ++++++++--
include/libnftables/rule.h | 10 ++++++++--
include/libnftables/ruleset.h | 8 ++++++++
include/libnftables/set.h | 10 ++++++++--
include/libnftables/table.h | 10 ++++++++--
7 files changed, 49 insertions(+), 10 deletions(-)
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 1/2] build: resolve automake 1.12 warning
2013-10-20 14:29 libnftables: build fixes Jan Engelhardt
@ 2013-10-20 14:29 ` Jan Engelhardt
2013-10-20 14:29 ` [PATCH 2/2] build: resolve build errors in dependent programs Jan Engelhardt
1 sibling, 0 replies; 5+ messages in thread
From: Jan Engelhardt @ 2013-10-20 14:29 UTC (permalink / raw)
To: netfilter-devel; +Cc: pablo
ltlibrary.am: archiver requires 'AM_PROG_AR' in 'configure.ac'
Signed-off-by: Jan Engelhardt <jengelh@inai.de>
---
configure.ac | 1 +
1 file changed, 1 insertion(+)
diff --git a/configure.ac b/configure.ac
index 4d601a6..4758a49 100644
--- a/configure.ac
+++ b/configure.ac
@@ -5,6 +5,7 @@ AC_CONFIG_AUX_DIR([build-aux])
AC_CANONICAL_HOST
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_HEADERS([config.h])
+m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
AM_INIT_AUTOMAKE([-Wall foreign tar-pax no-dist-gzip dist-bzip2
1.6 subdir-objects])
--
1.8.2
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 2/2] build: resolve build errors in dependent programs
2013-10-20 14:29 libnftables: build fixes Jan Engelhardt
2013-10-20 14:29 ` [PATCH 1/2] build: resolve automake 1.12 warning Jan Engelhardt
@ 2013-10-20 14:29 ` Jan Engelhardt
2013-10-27 21:01 ` Pablo Neira Ayuso
1 sibling, 1 reply; 5+ messages in thread
From: Jan Engelhardt @ 2013-10-20 14:29 UTC (permalink / raw)
To: netfilter-devel; +Cc: pablo
The headers do not compile standalone, which also causes nftables to
fail to build for the same reason. In addition, <stdbool.h> is not
needed for C++, and C++ should use contemporary headers if available,
which is hereby done.
chain.h:44:71: warning: "struct nlmsghdr" declared inside
parameter list [enabled by default]
chain.h:60:35: error: unknown type name "size_t"
expr.h:40:39: error: unknown type name "size_t"
rule.h:43:64: warning: "struct nlmsghdr" declared inside
parameter list [enabled by default]
rule.h:59:34: error: unknown type name "size_t"
ruleset.h:20:1: error: unknown type name "bool"
ruleset.h:20:59: error: unknown type name "uint16_t"
ruleset.h:39:37: error: unknown type name "size_t"
set.h:38:33: error: unknown type name "size_t"
table.h:32:71: warning: "struct nlmsghdr" declared inside
parameter list [enabled by default]
table.h:48:35: error: unknown type name "size_t"
Signed-off-by: Jan Engelhardt <jengelh@inai.de>
---
include/libnftables/chain.h | 10 ++++++++--
include/libnftables/expr.h | 10 ++++++++--
include/libnftables/rule.h | 10 ++++++++--
include/libnftables/ruleset.h | 8 ++++++++
include/libnftables/set.h | 10 ++++++++--
include/libnftables/table.h | 10 ++++++++--
6 files changed, 48 insertions(+), 10 deletions(-)
diff --git a/include/libnftables/chain.h b/include/libnftables/chain.h
index d3086ea..36522d6 100644
--- a/include/libnftables/chain.h
+++ b/include/libnftables/chain.h
@@ -1,14 +1,20 @@
#ifndef _CHAIN_H_
#define _CHAIN_H_
-#include <stdint.h>
-#include <stdbool.h>
+#if defined(__cplusplus) && __cplusplus >= 201100L
+# include <cstdint>
+#else
+# include <stdbool.h>
+# include <stdint.h>
+#endif
+#include <sys/types.h>
#ifdef __cplusplus
extern "C" {
#endif
struct nft_chain;
+struct nlmsghdr;
struct nft_chain *nft_chain_alloc(void);
void nft_chain_free(struct nft_chain *);
diff --git a/include/libnftables/expr.h b/include/libnftables/expr.h
index b8f1d1e..4c640f7 100644
--- a/include/libnftables/expr.h
+++ b/include/libnftables/expr.h
@@ -1,14 +1,20 @@
#ifndef _RULE_EXPR_H_
#define _RULE_EXPR_H_
-#include <stdint.h>
-#include <stdbool.h>
+#if defined(__cplusplus) && __cplusplus >= 201100L
+# include <cstdint>
+#else
+# include <stdbool.h>
+# include <stdint.h>
+#endif
+#include <sys/types.h>
#ifdef __cplusplus
extern "C" {
#endif
struct nft_rule_expr;
+struct nlmsghdr;
enum {
NFT_RULE_EXPR_ATTR_NAME = 0,
diff --git a/include/libnftables/rule.h b/include/libnftables/rule.h
index 9fba9c8..5876a98 100644
--- a/include/libnftables/rule.h
+++ b/include/libnftables/rule.h
@@ -1,8 +1,13 @@
#ifndef _RULE_H_
#define _RULE_H_
-#include <stdint.h>
-#include <stdbool.h>
+#if defined(__cplusplus) && __cplusplus >= 201100L
+# include <cstdint>
+#else
+# include <stdbool.h>
+# include <stdint.h>
+#endif
+#include <sys/types.h>
#ifdef __cplusplus
extern "C" {
@@ -10,6 +15,7 @@ extern "C" {
struct nft_rule;
struct nft_rule_expr;
+struct nlmsghdr;
struct nft_rule *nft_rule_alloc(void);
void nft_rule_free(struct nft_rule *);
diff --git a/include/libnftables/ruleset.h b/include/libnftables/ruleset.h
index a4a1279..cde75b1 100644
--- a/include/libnftables/ruleset.h
+++ b/include/libnftables/ruleset.h
@@ -1,6 +1,14 @@
#ifndef _RULESET_H_
#define _RULESET_H_
+#if defined(__cplusplus) && __cplusplus >= 201100L
+# include <cstdint>
+#else
+# include <stdbool.h>
+# include <stdint.h>
+#endif
+#include <sys/types.h>
+
#ifdef __cplusplus
extern "C" {
#endif
diff --git a/include/libnftables/set.h b/include/libnftables/set.h
index e377826..a25742b 100644
--- a/include/libnftables/set.h
+++ b/include/libnftables/set.h
@@ -1,8 +1,13 @@
#ifndef _NFT_SET_H_
#define _NFT_SET_H_
-#include <stdint.h>
-#include <stdbool.h>
+#if defined(__cplusplus) && __cplusplus >= 201100L
+# include <cstdint>
+#else
+# include <stdbool.h>
+# include <stdint.h>
+#endif
+#include <sys/types.h>
enum {
NFT_SET_ATTR_TABLE,
@@ -16,6 +21,7 @@ enum {
};
struct nft_set;
+struct nlmsghdr;
struct nft_set *nft_set_alloc(void);
void nft_set_free(struct nft_set *s);
diff --git a/include/libnftables/table.h b/include/libnftables/table.h
index 66574cf..815b6a7 100644
--- a/include/libnftables/table.h
+++ b/include/libnftables/table.h
@@ -1,14 +1,20 @@
#ifndef _TABLE_H_
#define _TABLE_H_
-#include <stdint.h>
-#include <stdbool.h>
+#if defined(__cplusplus) && __cplusplus >= 201100L
+# include <cstdint>
+#else
+# include <stdbool.h>
+# include <stdint.h>
+#endif
+#include <sys/types.h>
#ifdef __cplusplus
extern "C" {
#endif
struct nft_table;
+struct nlmsghdr;
struct nft_table *nft_table_alloc(void);
void nft_table_free(struct nft_table *);
--
1.8.2
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 2/2] build: resolve build errors in dependent programs
2013-10-20 14:29 ` [PATCH 2/2] build: resolve build errors in dependent programs Jan Engelhardt
@ 2013-10-27 21:01 ` Pablo Neira Ayuso
2013-10-28 12:27 ` Jan Engelhardt
0 siblings, 1 reply; 5+ messages in thread
From: Pablo Neira Ayuso @ 2013-10-27 21:01 UTC (permalink / raw)
To: Jan Engelhardt; +Cc: netfilter-devel
On Sun, Oct 20, 2013 at 04:29:16PM +0200, Jan Engelhardt wrote:
> The headers do not compile standalone, which also causes nftables to
> fail to build for the same reason. In addition, <stdbool.h> is not
> needed for C++, and C++ should use contemporary headers if available,
> which is hereby done.
>
> chain.h:44:71: warning: "struct nlmsghdr" declared inside
> parameter list [enabled by default]
> chain.h:60:35: error: unknown type name "size_t"
> expr.h:40:39: error: unknown type name "size_t"
> rule.h:43:64: warning: "struct nlmsghdr" declared inside
> parameter list [enabled by default]
> rule.h:59:34: error: unknown type name "size_t"
> ruleset.h:20:1: error: unknown type name "bool"
> ruleset.h:20:59: error: unknown type name "uint16_t"
> ruleset.h:39:37: error: unknown type name "size_t"
> set.h:38:33: error: unknown type name "size_t"
> table.h:32:71: warning: "struct nlmsghdr" declared inside
> parameter list [enabled by default]
> table.h:48:35: error: unknown type name "size_t"
This is fixing two different issues in one single patch.
I have applied a patch to add struct nlmsghdr without definition.
Regarding the c++ changes, we already discussed this in libmnl's
patch:
5b8a0c7 include: don't force compiler to enter C++11 mode
this change doesn't seem to be required by g++ at all.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 2/2] build: resolve build errors in dependent programs
2013-10-27 21:01 ` Pablo Neira Ayuso
@ 2013-10-28 12:27 ` Jan Engelhardt
0 siblings, 0 replies; 5+ messages in thread
From: Jan Engelhardt @ 2013-10-28 12:27 UTC (permalink / raw)
To: Pablo Neira Ayuso; +Cc: netfilter-devel
On Sunday 2013-10-27 22:01, Pablo Neira Ayuso wrote:
>On Sun, Oct 20, 2013 at 04:29:16PM +0200, Jan Engelhardt wrote:
>>
>> chain.h:44:71: warning: "struct nlmsghdr" declared inside
>> parameter list [enabled by default]
>> chain.h:60:35: error: unknown type name "size_t"
>
>This is fixing two different issues in one single patch.
>I have applied a patch to add struct nlmsghdr without definition.
Well, there's still size_t left.
>Regarding the c++ changes, we already discussed this in libmnl's
>patch:
>
>5b8a0c7 include: don't force compiler to enter C++11 mode
>
>this change doesn't seem to be required by g++ at all.
Not required by g++, but wanted by the standard. Also note that
in my current submission, I expressly specified
#if ... __cplusplus >= 2011UL.
which is how to tackle this. The remaining patches will be posted
by git-s-e shortly.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2013-10-28 12:27 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-20 14:29 libnftables: build fixes Jan Engelhardt
2013-10-20 14:29 ` [PATCH 1/2] build: resolve automake 1.12 warning Jan Engelhardt
2013-10-20 14:29 ` [PATCH 2/2] build: resolve build errors in dependent programs Jan Engelhardt
2013-10-27 21:01 ` Pablo Neira Ayuso
2013-10-28 12:27 ` Jan Engelhardt
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.