Skip to content

Commit 56c6ca8

Browse files
committed
Work on ObjFW support in block-sys
Support for ObjFW is still not enabled, see #117 for that.
1 parent 498e0a6 commit 56c6ca8

File tree

5 files changed

+10
-3
lines changed

5 files changed

+10
-3
lines changed

block-sys/build.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,19 @@ fn main() {
4747
// work (on newer GNUStep versions these headers are present)
4848
if env::var_os("CARGO_FEATURE_GNUSTEP_2_0").is_none() {
4949
let compat_headers =
50-
Path::new(env!("CARGO_MANIFEST_DIR")).join("gnustep-compat-headers");
50+
Path::new(env!("CARGO_MANIFEST_DIR")).join("compat-headers/gnustep");
5151
cc_args.push_str(" -I");
5252
cc_args.push_str(compat_headers.to_str().unwrap());
5353
}
5454
}
55-
(false, false, false, true) => unimplemented!(),
55+
(false, false, false, true) => {
56+
// Add compability headers to make `#include <Block.h>` work.
57+
let compat_headers = Path::new(env!("CARGO_MANIFEST_DIR")).join("compat-headers/objfw");
58+
cc_args.push_str(" -I");
59+
cc_args.push_str(compat_headers.to_str().unwrap());
60+
println!("cargo:rustc-link-lib=dylib=objfw");
61+
unimplemented!("ObjFW is not yet supported")
62+
}
5663
// Checked in if-let above
5764
(false, false, false, false) => unreachable!(),
5865
(_, _, _, _) => panic!("Invalid feature combination; only one runtime may be selected!"),
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
#include <ObjFW/block.h>

block-sys/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,6 @@ pub struct Block_descriptor {
301301
///
302302
/// Requires BLOCK_HAS_SIGNATURE
303303
#[repr(C)]
304-
#[cfg(not(feature = "objfw"))]
305304
pub struct Block_descriptor_basic {
306305
pub header: Block_descriptor_header,
307306

0 commit comments

Comments
 (0)