Skip to content

Commit ec3430e

Browse files
committed
Remove lang-compat feature
1 parent 61a3414 commit ec3430e

25 files changed

+1512
-1526
lines changed

Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ winapi = { version = "0.3", features = ["winnt", "combaseapi", "oleauto", "roapi
1717

1818
[features]
1919
nightly = []
20-
lang-compat = []
2120
windows-ai = []
2221
windows-applicationmodel = []
2322
windows-data = []

Generator/Types/EnumDef.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public override void Emit()
3333
{
3434
Module.Append($@"
3535
RT_ENUM! {{ enum { DefinitionName }: { UnderlyingTypeName } {{
36-
{ String.Join(", ", Type.Fields.Where(f => f.Name != "value__").Select(f => $"{ NameHelpers.PreventKeywords(f.Name) } ({ Type.Name }_{ f.Name }) = { f.Constant }")) },
36+
{ String.Join(", ", Type.Fields.Where(f => f.Name != "value__").Select(f => $"{ NameHelpers.PreventKeywords(f.Name) } = { f.Constant }")) },
3737
}}}}");
3838
}
3939
}

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ This library is still subject to breaking changes, but it is already possible to
88
Creating custom WinRT classes using inheritance is not yet supported, so it is currently not possible to create user interfaces using *XAML*.
99

1010
## Prerequisites
11-
Using this crate requires at least Rust 1.20. A compatibility mode that requires only Rust 1.15 can be enabled with the `lang-compat` Cargo feature.
11+
Using this crate requires at least Rust 1.25.
1212
Additional nightly features (e.g. using specialization) can be enabled with the `nightly` Cargo feature.
1313

1414
## Design

src/lib.rs

-11
Original file line numberDiff line numberDiff line change
@@ -97,14 +97,3 @@ mod prelude {
9797
Err(::result::Error::from_hresult(hr))
9898
}
9999
}
100-
101-
// For definitions that are different depending on the lang-compat feature
102-
#[cfg(not(feature = "lang-compat"))]
103-
mod langcompat {
104-
pub const ASYNC_STATUS_COMPLETED: ::windows::foundation::AsyncStatus = ::windows::foundation::AsyncStatus::Completed;
105-
}
106-
107-
#[cfg(feature = "lang-compat")]
108-
mod langcompat {
109-
pub const ASYNC_STATUS_COMPLETED: ::windows::foundation::AsyncStatus = ::windows::foundation::AsyncStatus_Completed;
110-
}

src/rt/async.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ macro_rules! impl_blocking_wait {
4747
let info = ::comptr::query_interface::<_, IAsyncInfo>(self).expect("query_interface failed");
4848
let status = info.get_status().expect("get_status failed");
4949

50-
if status == ::langcompat::ASYNC_STATUS_COMPLETED {
50+
if status == ::windows::foundation::AsyncStatus::Completed {
5151
return;
5252
}
5353

src/rt/gen/windows/ai.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ impl ILearningModelDeviceFactory {
224224
}}
225225
}
226226
RT_ENUM! { enum LearningModelDeviceKind: i32 {
227-
Default (LearningModelDeviceKind_Default) = 0, Cpu (LearningModelDeviceKind_Cpu) = 1, DirectX (LearningModelDeviceKind_DirectX) = 2, DirectXHighPerformance (LearningModelDeviceKind_DirectXHighPerformance) = 3, DirectXMinPower (LearningModelDeviceKind_DirectXMinPower) = 4,
227+
Default = 0, Cpu = 1, DirectX = 2, DirectXHighPerformance = 3, DirectXMinPower = 4,
228228
}}
229229
DEFINE_IID!(IID_ILearningModelDeviceStatics, 1240670471, 43199, 17083, 146, 199, 16, 177, 45, 197, 210, 31);
230230
RT_INTERFACE!{static interface ILearningModelDeviceStatics(ILearningModelDeviceStaticsVtbl): IInspectable(IInspectableVtbl) [IID_ILearningModelDeviceStatics] {
@@ -297,7 +297,7 @@ impl ILearningModelFeatureDescriptor {
297297
}}
298298
}
299299
RT_ENUM! { enum LearningModelFeatureKind: i32 {
300-
Tensor (LearningModelFeatureKind_Tensor) = 0, Sequence (LearningModelFeatureKind_Sequence) = 1, Map (LearningModelFeatureKind_Map) = 2, Image (LearningModelFeatureKind_Image) = 3,
300+
Tensor = 0, Sequence = 1, Map = 2, Image = 3,
301301
}}
302302
DEFINE_IID!(IID_ILearningModelFeatureValue, 4111467995, 16517, 19966, 159, 237, 149, 235, 12, 12, 247, 92);
303303
RT_INTERFACE!{interface ILearningModelFeatureValue(ILearningModelFeatureValueVtbl): IInspectable(IInspectableVtbl) [IID_ILearningModelFeatureValue] {
@@ -964,7 +964,7 @@ impl ITensorInt8BitStatics {
964964
}}
965965
}
966966
RT_ENUM! { enum TensorKind: i32 {
967-
Undefined (TensorKind_Undefined) = 0, Float (TensorKind_Float) = 1, UInt8 (TensorKind_UInt8) = 2, Int8 (TensorKind_Int8) = 3, UInt16 (TensorKind_UInt16) = 4, Int16 (TensorKind_Int16) = 5, Int32 (TensorKind_Int32) = 6, Int64 (TensorKind_Int64) = 7, String (TensorKind_String) = 8, Boolean (TensorKind_Boolean) = 9, Float16 (TensorKind_Float16) = 10, Double (TensorKind_Double) = 11, UInt32 (TensorKind_UInt32) = 12, UInt64 (TensorKind_UInt64) = 13, Complex64 (TensorKind_Complex64) = 14, Complex128 (TensorKind_Complex128) = 15,
967+
Undefined = 0, Float = 1, UInt8 = 2, Int8 = 3, UInt16 = 4, Int16 = 5, Int32 = 6, Int64 = 7, String = 8, Boolean = 9, Float16 = 10, Double = 11, UInt32 = 12, UInt64 = 13, Complex64 = 14, Complex128 = 15,
968968
}}
969969
DEFINE_IID!(IID_ITensorString, 1478702536, 48561, 17936, 188, 117, 53, 233, 203, 240, 9, 183);
970970
RT_INTERFACE!{interface ITensorString(ITensorStringVtbl): IInspectable(IInspectableVtbl) [IID_ITensorString] {
@@ -1254,7 +1254,7 @@ impl ITensorUInt8BitStatics {
12541254
pub mod preview { // Windows.AI.MachineLearning.Preview
12551255
use ::prelude::*;
12561256
RT_ENUM! { enum FeatureElementKindPreview: i32 {
1257-
Undefined (FeatureElementKindPreview_Undefined) = 0, Float (FeatureElementKindPreview_Float) = 1, UInt8 (FeatureElementKindPreview_UInt8) = 2, Int8 (FeatureElementKindPreview_Int8) = 3, UInt16 (FeatureElementKindPreview_UInt16) = 4, Int16 (FeatureElementKindPreview_Int16) = 5, Int32 (FeatureElementKindPreview_Int32) = 6, Int64 (FeatureElementKindPreview_Int64) = 7, String (FeatureElementKindPreview_String) = 8, Boolean (FeatureElementKindPreview_Boolean) = 9, Float16 (FeatureElementKindPreview_Float16) = 10, Double (FeatureElementKindPreview_Double) = 11, UInt32 (FeatureElementKindPreview_UInt32) = 12, UInt64 (FeatureElementKindPreview_UInt64) = 13, Complex64 (FeatureElementKindPreview_Complex64) = 14, Complex128 (FeatureElementKindPreview_Complex128) = 15,
1257+
Undefined = 0, Float = 1, UInt8 = 2, Int8 = 3, UInt16 = 4, Int16 = 5, Int32 = 6, Int64 = 7, String = 8, Boolean = 9, Float16 = 10, Double = 11, UInt32 = 12, UInt64 = 13, Complex64 = 14, Complex128 = 15,
12581258
}}
12591259
DEFINE_IID!(IID_IImageVariableDescriptorPreview, 2061630066, 670, 19909, 162, 248, 95, 183, 99, 21, 65, 80);
12601260
RT_INTERFACE!{interface IImageVariableDescriptorPreview(IImageVariableDescriptorPreviewVtbl): IInspectable(IInspectableVtbl) [IID_IImageVariableDescriptorPreview] {
@@ -1436,7 +1436,7 @@ impl ILearningModelDescriptionPreview {
14361436
}
14371437
RT_CLASS!{class LearningModelDescriptionPreview: ILearningModelDescriptionPreview}
14381438
RT_ENUM! { enum LearningModelDeviceKindPreview: i32 {
1439-
LearningDeviceAny (LearningModelDeviceKindPreview_LearningDeviceAny) = 0, LearningDeviceCpu (LearningModelDeviceKindPreview_LearningDeviceCpu) = 1, LearningDeviceGpu (LearningModelDeviceKindPreview_LearningDeviceGpu) = 2, LearningDeviceNpu (LearningModelDeviceKindPreview_LearningDeviceNpu) = 3, LearningDeviceDsp (LearningModelDeviceKindPreview_LearningDeviceDsp) = 4, LearningDeviceFpga (LearningModelDeviceKindPreview_LearningDeviceFpga) = 5,
1439+
LearningDeviceAny = 0, LearningDeviceCpu = 1, LearningDeviceGpu = 2, LearningDeviceNpu = 3, LearningDeviceDsp = 4, LearningDeviceFpga = 5,
14401440
}}
14411441
DEFINE_IID!(IID_ILearningModelEvaluationResultPreview, 3743804063, 39011, 16520, 132, 152, 135, 161, 244, 104, 111, 146);
14421442
RT_INTERFACE!{interface ILearningModelEvaluationResultPreview(ILearningModelEvaluationResultPreviewVtbl): IInspectable(IInspectableVtbl) [IID_ILearningModelEvaluationResultPreview] {
@@ -1457,7 +1457,7 @@ impl ILearningModelEvaluationResultPreview {
14571457
}
14581458
RT_CLASS!{class LearningModelEvaluationResultPreview: ILearningModelEvaluationResultPreview}
14591459
RT_ENUM! { enum LearningModelFeatureKindPreview: i32 {
1460-
Undefined (LearningModelFeatureKindPreview_Undefined) = 0, Tensor (LearningModelFeatureKindPreview_Tensor) = 1, Sequence (LearningModelFeatureKindPreview_Sequence) = 2, Map (LearningModelFeatureKindPreview_Map) = 3, Image (LearningModelFeatureKindPreview_Image) = 4,
1460+
Undefined = 0, Tensor = 1, Sequence = 2, Map = 3, Image = 4,
14611461
}}
14621462
DEFINE_IID!(IID_ILearningModelPreview, 77342314, 37812, 18316, 174, 184, 112, 21, 123, 240, 255, 148);
14631463
RT_INTERFACE!{interface ILearningModelPreview(ILearningModelPreviewVtbl): IInspectable(IInspectableVtbl) [IID_ILearningModelPreview] {

0 commit comments

Comments
 (0)