diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 48e1d8d..cf9f821 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -12,6 +12,8 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: + feature_flags: [byond-515-1621, byond-516-1651] + os: [ubuntu-latest, windows-latest] include: - os: ubuntu-latest target_name: i686-unknown-linux-gnu @@ -39,7 +41,7 @@ jobs: with: toolchain: stable command: check - args: --target ${{ matrix.target_name }} + args: --target ${{ matrix.target_name }} --no-default-features --features ${{ matrix.feature_flags }} check_fmt: name: Check format diff --git a/crates/byondapi-rs-test/Cargo.toml b/crates/byondapi-rs-test/Cargo.toml index edfe2cb..4928ddc 100644 --- a/crates/byondapi-rs-test/Cargo.toml +++ b/crates/byondapi-rs-test/Cargo.toml @@ -9,7 +9,12 @@ edition = "2021" crate-type = ["cdylib"] [dependencies] -byondapi = { path = "../byondapi-rs" } +byondapi = { path = "../byondapi-rs", default-features = false } tempfile = "3.17.1" cargo_metadata = "0.19.1" eyre = "0.6.12" + +[features] +default = ["byond-516-1651"] +byond-515-1621 = ["byondapi/byond-515-1621",] +byond-516-1651 = ["byondapi/byond-516-1651"] \ No newline at end of file diff --git a/crates/byondapi-rs/src/value/functions.rs b/crates/byondapi-rs/src/value/functions.rs index a70c4e9..30a850f 100644 --- a/crates/byondapi-rs/src/value/functions.rs +++ b/crates/byondapi-rs/src/value/functions.rs @@ -117,6 +117,7 @@ impl ByondValue { /// Replaces whatever is currently in this value with a string that's pointed to by the stringid /// # DO NOT PASS STRINGIDS THAT ARE NOT RETURNED BY [`crate::byond_string::str_id_of`] + #[cfg(feature = "byond-516-1651")] pub fn set_strid(&mut self, strid: u4c) { unsafe { byond().ByondValue_SetStrId(&mut self.0, strid) } } @@ -249,6 +250,7 @@ impl ByondValue { unsafe { byond().ByondValue_DecRef(&self.0) } } + #[cfg(feature = "byond-516-1651")] pub fn decrement_tempref(&mut self) { unsafe { byond().ByondValue_DecTempRef(&self.0) } }