From 893f89b64427421bac7c9b364b4e94b90a8d2ebd Mon Sep 17 00:00:00 2001 From: OlivierHecart Date: Wed, 30 Aug 2023 18:51:51 +0200 Subject: [PATCH] Remove conditional compilation --- .github/workflows/ci.yml | 4 ++-- .github/workflows/release.yml | 4 ++-- include/zenoh_commons.h | 6 ------ src/commons.rs | 6 ------ src/get.rs | 5 +---- 5 files changed, 5 insertions(+), 20 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a4433422c..2ab5a68d1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,7 +29,7 @@ jobs: uses: actions-rs/cargo@v1 with: command: clippy - args: --all --examples -- -D warnings + args: --all --examples --features=logger-autoinit --features=shared-memory -- -D warnings - name: Run rustfmt uses: actions-rs/cargo@v1 @@ -68,7 +68,7 @@ jobs: uses: actions-rs/cargo@v1 with: command: test - args: --verbose --release + args: --verbose --release --features=logger-autoinit --features=shared-memory - name: Upload artifact uses: actions/upload-artifact@v2 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7c61bce77..6a12be22b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -39,7 +39,7 @@ jobs: uses: actions-rs/cargo@v1 with: command: clippy - args: -- -D warnings + args: --features=logger-autoinit --features=shared-memory -- -D warnings - name: Environment setup id: env shell: bash @@ -165,7 +165,7 @@ jobs: with: use-cross: ${{ matrix.job.use-cross }} command: build - args: --release --target=${{ matrix.job.target }} + args: --release --target=${{ matrix.job.target }} --features=logger-autoinit --features=shared-memory - name: Debian package - libzenohc if: contains(matrix.job.target, '-linux-gnu') diff --git a/include/zenoh_commons.h b/include/zenoh_commons.h index dfdc40248..2303db30d 100644 --- a/include/zenoh_commons.h +++ b/include/zenoh_commons.h @@ -221,11 +221,6 @@ typedef struct z_owned_closure_query_t { * To check if `val` is still valid, you may use `z_X_check(&val)` (or `z_check(val)` if your compiler supports `_Generic`), which will return `true` if `val` is valid. */ #if defined(TARGET_ARCH_X86_64) -typedef struct ALIGN(8) z_owned_reply_t { - uint64_t _0[22]; -} z_owned_reply_t; -#endif -#if defined(TARGET_ARCH_X86_64) typedef struct ALIGN(8) z_owned_reply_t { uint64_t _0[23]; } z_owned_reply_t; @@ -667,7 +662,6 @@ typedef struct z_subscriber_t { */ typedef struct zc_owned_payload_t { struct z_bytes_t payload; - uintptr_t _owner[4]; uintptr_t _owner[5]; } zc_owned_payload_t; typedef struct zc_owned_shmbuf_t { diff --git a/src/commons.rs b/src/commons.rs index 91b5b7afa..91f7751c2 100644 --- a/src/commons.rs +++ b/src/commons.rs @@ -96,9 +96,6 @@ impl From> for z_timestamp_t { #[repr(C)] pub struct zc_owned_payload_t { pub payload: z_bytes_t, - #[cfg(not(feature = "shared-memory"))] - pub _owner: [usize; 4], - #[cfg(feature = "shared-memory")] pub _owner: [usize; 5], } impl Default for zc_owned_payload_t { @@ -179,9 +176,6 @@ pub extern "C" fn zc_payload_null() -> zc_owned_payload_t { len: 0, start: std::ptr::null(), }, - #[cfg(not(feature = "shared-memory"))] - _owner: [0; 4], - #[cfg(feature = "shared-memory")] _owner: [0; 5], } } diff --git a/src/get.rs b/src/get.rs index 0fdeb1892..ddca8c9c9 100644 --- a/src/get.rs +++ b/src/get.rs @@ -42,10 +42,7 @@ type ReplyInner = Option; /// After a move, `val` will still exist, but will no longer be valid. The destructors are double-drop-safe, but other functions will still trust that your `val` is valid. /// /// To check if `val` is still valid, you may use `z_X_check(&val)` (or `z_check(val)` if your compiler supports `_Generic`), which will return `true` if `val` is valid. -#[cfg(all(target_arch = "x86_64", not(feature = "shared-memory")))] -#[repr(C, align(8))] -pub struct z_owned_reply_t([u64; 22]); -#[cfg(all(target_arch = "x86_64", feature = "shared-memory"))] +#[cfg(target_arch = "x86_64")] #[repr(C, align(8))] pub struct z_owned_reply_t([u64; 23]);