[vala/0.52] linux: Substitute linux/if.h with net/if.h
- From: Rico Tzschichholz <ricotz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/0.52] linux: Substitute linux/if.h with net/if.h
- Date: Tue, 20 Jul 2021 08:40:48 +0000 (UTC)
commit 7badbfba89fb0242355cb0ddfc334e1596332b11
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 37441b0fa..a09b6423a 100644
--- a/vapi/linux.vapi
+++ b/vapi/linux.vapi
@@ -1302,7 +1302,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")]
@@ -1312,7 +1312,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,
@@ -1331,13 +1331,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;
@@ -1347,7 +1347,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;
@@ -1368,7 +1368,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]