Skip to content

Commit

Permalink
Minor touchups to conditional compilation
Browse files Browse the repository at this point in the history
Signed-off-by: Jonathan Schwender <[email protected]>
  • Loading branch information
jschwe committed Jan 4, 2025
1 parent c111697 commit 600880e
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ use crate::types::*;
#[allow(unused_imports)]
#[cfg(feature = "api-12")]
use crate::error_code::OH_Drawing_ErrorCode;
#[cfg(feature = "api-12")]
use crate::font::OH_Drawing_Font_Metrics;
use crate::text_declaration::*;

Expand Down
2 changes: 2 additions & 0 deletions scripts/generator/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,7 @@ fn get_bindings_config(api_version: u32) -> Vec<BindingConf> {
})
.raw_line("use super::native_image_ffi::*;")
.raw_line("use crate::native_window::OHNativeWindow;")
.raw_line("#[cfg(feature = \"api-12\")]")
.raw_line("use crate::native_window::OHNativeWindowBuffer;")
.allowlist_recursively(false)
.allowlist_function(".*NativeWindow.*")
Expand Down Expand Up @@ -642,6 +643,7 @@ fn get_module_bindings_config(api_version: u32) -> Vec<DirBindingsConf> {
"text_typography" => {
builder
.raw_line("use crate::text_declaration::*;")
.raw_line("#[cfg(feature = \"api-12\")]")
.raw_line("use crate::font::OH_Drawing_Font_Metrics;")
// FIXME: This needs to be guarded behind API-level-12 (fixed in SDK-13)
// We blocklist for now and remove when updating to SDK-13
Expand Down
8 changes: 4 additions & 4 deletions src/native_buffer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ extern "C" {}
mod native_buffer_ffi;
pub use native_buffer_ffi::*;

#[cfg(feature = "native_window")]
#[cfg_attr(docsrs, doc(cfg(feature = "native_window")))]
#[cfg(all(feature = "native_window", feature = "api-12"))]
#[cfg_attr(docsrs, doc(cfg(all(feature = "native_window", feature = "api-12"))))]
mod native_buffer_window_ffi;
#[cfg(feature = "native_window")]
#[cfg_attr(docsrs, doc(cfg(feature = "native_window")))]
#[cfg(all(feature = "native_window", feature = "api-12"))]
#[cfg_attr(docsrs, doc(cfg(all(feature = "native_window", feature = "api-12"))))]
pub use native_buffer_window_ffi::*;
1 change: 1 addition & 0 deletions src/native_image/native_image_window_ffi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#![allow(non_snake_case)]
use super::native_image_ffi::*;
use crate::native_window::OHNativeWindow;
#[cfg(feature = "api-12")]
use crate::native_window::OHNativeWindowBuffer;

extern "C" {
Expand Down

0 comments on commit 600880e

Please sign in to comment.