Skip to content

Commit

Permalink
reorganize com crate for bindgen upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
youyuanwu committed Jan 7, 2025
1 parent d9e9492 commit 092145f
Show file tree
Hide file tree
Showing 9 changed files with 10 additions and 9 deletions.
File renamed without changes.
1 change: 1 addition & 0 deletions crates/libs/com/src/Microsoft/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pub mod ServiceFabric;
4 changes: 2 additions & 2 deletions crates/libs/com/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
#![doc(html_no_source)]
// extern crate windows;
#![allow(non_snake_case)]
pub mod ServiceFabric;
pub mod Microsoft;

// expose mod directly
pub use ServiceFabric::*;
pub use Microsoft::ServiceFabric::*;

// Special usage for mssf_pal.
// See mssf_pal documentations for why this is used this way.
Expand Down
4 changes: 2 additions & 2 deletions crates/libs/core/src/error/errorcode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ macro_rules! define_fabric_error_code{

// defines SF error codes.
$(
$code = mssf_com::ServiceFabric::FabricTypes::$code .0,
$code = mssf_com::FabricTypes::$code .0,
)*
}

Expand All @@ -71,7 +71,7 @@ macro_rules! define_fabric_error_code{
)*
// SF code converts.
$(
mssf_com::ServiceFabric::FabricTypes::$code => Ok(Self::$code),
mssf_com::FabricTypes::$code => Ok(Self::$code),
)*
_ => Err("Unknown FABRIC_ERROR_CODE")
}
Expand Down
10 changes: 5 additions & 5 deletions crates/tools/api/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ use windows_bindgen::{bindgen, Result};
fn main() -> Result<()> {
let winmd = "./build/_deps/fabric_metadata-src/.windows/winmd/Microsoft.ServiceFabric.winmd";
// create output dir if not exist
fs::create_dir_all("crates/libs/com/src/ServiceFabric/").unwrap();
fs::create_dir_all("crates/libs/com/src/Microsoft/ServiceFabric/").unwrap();
// Generate FabricTypes
{
let out_file = "crates/libs/com/src/ServiceFabric/FabricTypes.rs";
let out_file = "crates/libs/com/src/Microsoft/ServiceFabric/FabricTypes/mod.rs";
let log = bindgen([
"--in",
winmd,
Expand All @@ -35,7 +35,7 @@ fn main() -> Result<()> {
}
// Generate FabricCommon
{
let out_file = "crates/libs/com/src/ServiceFabric/FabricCommon.rs";
let out_file = "crates/libs/com/src/Microsoft/ServiceFabric/FabricCommon/mod.rs";
let log = bindgen([
"--in",
winmd,
Expand All @@ -62,7 +62,7 @@ fn main() -> Result<()> {
}
// Generate FabricRuntime
{
let out_file = "crates/libs/com/src/ServiceFabric/FabricRuntime.rs";
let out_file = "crates/libs/com/src/Microsoft/ServiceFabric/FabricRuntime/mod.rs";
let log = bindgen([
"--in",
winmd,
Expand Down Expand Up @@ -103,7 +103,7 @@ fn main() -> Result<()> {

// Generate FabricClient
{
let out_file = "crates/libs/com/src/ServiceFabric/FabricClient.rs";
let out_file = "crates/libs/com/src/Microsoft/ServiceFabric/FabricClient/mod.rs";
let log = bindgen([
"--in",
winmd,
Expand Down

0 comments on commit 092145f

Please sign in to comment.