Skip to contentSkip to conversation

package/libiio: fix C# build

PATCH Applied Fabrice Fontaine 2 participants 2 messages Sep 5, 2021 – Sep 11, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/libiio: fix C# build

C# build is broken since bump to version 0.23 in commit 50b6d7d69f880e940d7c281c493a6a6694d6ebe3:

/tmp/instance-0/output-1/build/libiio-0.23/bindings/csharp/Device.cs(211,32): error CS0106: The modifier `readonly' is not valid for this item

Fixes:
- http://autobuild.buildroot.org/results/a26cce9760c75c44ebdcf21dfb4a69aad5702de4

---
 ...rs-setters-cannot-be-marked-readonly.patch | 32 +++++++++++++++++++
 1 file changed, 32 insertions(+)
 create mode 100644 package/libiio/0001-C-public-fields-with-getters-setters-cannot-be-marked-readonly.patch
package/libiio/0001-C-public-fields-with-getters-setters-cannot-be-marked-readonly.patch new file +32 -0
new file mode 100644
index 0000000000..a665d48363
@@ -0,0 +1,32 @@
+From 85bf9cd32138539252ed01c355cf766612cf47c9 Mon Sep 17 00:00:00 2001
+From: Paul Cercueil <[email protected]>
+Date: Thu, 2 Sep 2021 11:04:21 +0100
+Subject: [PATCH] C#: public fields with getters/setters cannot be marked
+ readonly
+
+MSVC would fail with the following error:
+error CS0106: The modifier 'readonly' is not valid for this item
+
+Reported-by: Raluca Chis <[email protected]>
+Signed-off-by: Paul Cercueil <[email protected]>
+
+[Retrieved from:
+https://github.com/analogdevicesinc/libiio/commit/85bf9cd32138539252ed01c355cf766612cf47c9]
+Signed-off-by: Fabrice Fontaine <[email protected]>
+---
+ bindings/csharp/Device.cs | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/bindings/csharp/Device.cs b/bindings/csharp/Device.cs
+index 96214243f..6c8c8f4f3 100644
+--- a/bindings/csharp/Device.cs
++++ b/bindings/csharp/Device.cs
+@@ -208,7 +208,7 @@ public override void write(string str)
+         public readonly string name;
+ 
+         /// <summary>The label of this device.</summary>
+-        public readonly string label { get; private set; }
++        public string label { get; private set; }
+ 
+         /// <summary>A <c>list</c> of all the attributes that this device has.</summary>
+         public readonly List<Attr> attrs;
Signature · 6 lines
2.33.0

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw
Quoted 9 lines · Fabrice Fontaine

C# build is broken since bump to version 0.23 in commit 50b6d7d69f880e940d7c281c493a6a6694d6ebe3:

/tmp/instance-0/output-1/build/libiio-0.23/bindings/csharp/Device.cs(211,32): error CS0106: The modifier `readonly' is not valid for this item

Fixes:
- http://autobuild.buildroot.org/results/a26cce9760c75c44ebdcf21dfb4a69aad5702de4

Applied to master, thanks.

Regards,
Arnout

Quoted 34 lines
---
 ...rs-setters-cannot-be-marked-readonly.patch | 32 +++++++++++++++++++
 1 file changed, 32 insertions(+)
 create mode 100644 package/libiio/0001-C-public-fields-with-getters-setters-cannot-be-marked-readonly.patch
package/libiio/0001-C-public-fields-with-getters-setters-cannot-be-marked-readonly.patch new file +22 -0
new file mode 100644
index 0000000000..a665d48363
@@ -0,0 +1,32 @@
+From 85bf9cd32138539252ed01c355cf766612cf47c9 Mon Sep 17 00:00:00 2001
+From: Paul Cercueil <[email protected]>
+Date: Thu, 2 Sep 2021 11:04:21 +0100
+Subject: [PATCH] C#: public fields with getters/setters cannot be marked
+ readonly
+
+MSVC would fail with the following error:
+error CS0106: The modifier 'readonly' is not valid for this item
+
+Reported-by: Raluca Chis <[email protected]>
+Signed-off-by: Paul Cercueil <[email protected]>
+
+[Retrieved from:
+https://github.com/analogdevicesinc/libiio/commit/85bf9cd32138539252ed01c355cf766612cf47c9]
+Signed-off-by: Fabrice Fontaine <[email protected]>
+---
+ bindings/csharp/Device.cs | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/bindings/csharp/Device.cs b/bindings/csharp/Device.cs
+index 96214243f..6c8c8f4f3 100644
+--- a/bindings/csharp/Device.cs

package/libiio/0001-C-public-fields-with-getters-setters-cannot-be-marked-readonly.patch line 32

Quoted 10 lines
package/libiio/0001-C-public-fields-with-getters-setters-cannot-be-marked-readonly.patch new file +10 -0
++++ b/bindings/csharp/Device.cs
+@@ -208,7 +208,7 @@ public override void write(string str)
+         public readonly string name;
+ 
+         /// <summary>The label of this device.</summary>
+-        public readonly string label { get; private set; }
++        public string label { get; private set; }
+ 
+         /// <summary>A <c>list</c> of all the attributes that this device has.</summary>
+         public readonly List<Attr> attrs;

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot