[vala/wip/mickeyl/linux-socketcan: 13/15] linux: substitute linux/if.h with net/if.h
- From: Rico Tzschichholz <ricotz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/wip/mickeyl/linux-socketcan: 13/15] linux: substitute linux/if.h with net/if.h
- Date: Tue, 25 May 2021 10:26:05 +0000 (UTC)
commit 20db374ec2032719eff7317ffe390a12cdfe318c
Author: Dr. Michael Lauer <mickey vanille-media de>
Date: Mon May 24 16:50:24 2021 +0200
linux: substitute linux/if.h with net/if.h
There is an age-old conflict between linux/if.h (the kernel header) and
net/if.h (the userland header) that leads to compile errors due to
redeclaration of certain network-related structures, see e.g. the following links:
- https://bugs.launchpad.net/ubuntu/+source/eglibc/+bug/673073
- https://lists.debian.org/debian-kernel/2017/06/msg00003.html
- https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=824442
FWIW, it still seems to be a very current problem which I just stumbled over _again_.
By now all the relevant structures should have counterparts in net/if.h, so let's try
to just not include the kernel header, but use the userland header instead.
vapi/linux.vapi | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/vapi/linux.vapi b/vapi/linux.vapi
index 225566e94..ff6fa3aaa 100644
--- a/vapi/linux.vapi
+++ b/vapi/linux.vapi
@@ -1349,7 +1349,7 @@ namespace Linux {
namespace Network {
// interface consts, structs, and methods
- [CCode (cname = "IFNAMSIZ", cheader_filename = "sys/socket.h,linux/if.h")]
+ [CCode (cname = "IFNAMSIZ", cheader_filename = "sys/socket.h,net/if.h")]
public const int INTERFACE_NAME_SIZE;
[CCode (cheader_filename = "net/if.h")]
@@ -1359,7 +1359,7 @@ namespace Linux {
[CCode (cheader_filename = "net/if.h")]
public IfNameindex if_nameindex ();
- [CCode (cname = "int", cprefix = "IFF_", has_type_id = false, cheader_filename =
"sys/socket.h,linux/if.h")]
+ [CCode (cname = "int", cprefix = "IFF_", has_type_id = false, cheader_filename =
"sys/socket.h,net/if.h")]
public enum IfFlag {
UP,
BROADCAST,
@@ -1378,13 +1378,13 @@ namespace Linux {
DYNAMIC
}
- [CCode (cname = "struct if_nameindex", has_type_id = false, cheader_filename =
"sys/socket.h,linux/if.h", destroy_function = "if_freenameindex")]
+ [CCode (cname = "struct if_nameindex", has_type_id = false, cheader_filename =
"sys/socket.h,net/if.h", destroy_function = "if_freenameindex")]
public struct IfNameindex {
public uint if_index;
public string if_name;
}
- [CCode (cname = "struct ifmap", has_type_id = false, cheader_filename = "sys/socket.h,linux/if.h",
destroy_function = "")]
+ [CCode (cname = "struct ifmap", has_type_id = false, cheader_filename = "sys/socket.h,net/if.h",
destroy_function = "")]
public struct IfMap {
public ulong mem_start;
public ulong mem_end;
@@ -1394,7 +1394,7 @@ namespace Linux {
public uchar port;
}
- [CCode (cname = "struct ifreq", has_type_id = false, cheader_filename = "netinet/in.h,linux/if.h",
destroy_function = "")]
+ [CCode (cname = "struct ifreq", has_type_id = false, cheader_filename = "netinet/in.h,net/if.h",
destroy_function = "")]
public struct IfReq {
[CCode (array_length = false)]
public char[] ifr_name;
@@ -1415,7 +1415,7 @@ namespace Linux {
public char[] ifr_newname;
}
- [CCode (cname = "struct ifconf", has_type_id = false, cheader_filename = "sys/socket.h,linux/if.h",
destroy_function = "")]
+ [CCode (cname = "struct ifconf", has_type_id = false, cheader_filename = "sys/socket.h,net/if.h",
destroy_function = "")]
public struct IfConf {
public int ifc_len;
public string ifc_buf;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]