From 5a822eda321e71b9e2251dbf4c6b3ea14f12e33d Mon Sep 17 00:00:00 2001 From: Julian Orth Date: Tue, 3 May 2022 00:09:28 +0200 Subject: [PATCH] config: fix test compile error --- jay-config/src/macros.rs | 2 +- src/config.rs | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/jay-config/src/macros.rs b/jay-config/src/macros.rs index ce1f5949..5ec79ea0 100644 --- a/jay-config/src/macros.rs +++ b/jay-config/src/macros.rs @@ -3,7 +3,7 @@ macro_rules! config { ($f:path) => { #[no_mangle] #[used] - pub static mut JAY_CONFIG_ENTRY: $crate::_private::ConfigEntry = { + pub static mut JAY_CONFIG_ENTRY_V1: $crate::_private::ConfigEntry = { struct X; impl $crate::_private::Config for X { extern "C" fn configure() { diff --git a/src/config.rs b/src/config.rs index d66dccc6..ba4e3895 100644 --- a/src/config.rs +++ b/src/config.rs @@ -5,7 +5,6 @@ use { backend::{ConnectorId, InputDeviceId}, config::handler::ConfigProxyHandler, ifs::wl_seat::SeatId, - it::test_config::TEST_CONFIG_ENTRY, state::State, utils::{ clonecell::CloneCell, numcell::NumCell, oserror::OsError, ptr_ext::PtrExt, @@ -26,6 +25,8 @@ use { std::{cell::Cell, mem, ptr, rc::Rc}, thiserror::Error, }; +#[cfg(feature = "it")] +use crate::it::test_config::TEST_CONFIG_ENTRY; #[derive(Debug, Error)] pub enum ConfigError { @@ -231,7 +232,7 @@ impl ConfigProxy { Ok(l) => l, Err(e) => return Err(ConfigError::CouldNotLoadLibrary(e)), }; - let entry = lib.get::<&'static ConfigEntry>(b"JAY_CONFIG_ENTRY\0"); + let entry = lib.get::<&'static ConfigEntry>(b"JAY_CONFIG_ENTRY_V1\0"); let entry = match entry { Ok(e) => *e, Err(e) => return Err(ConfigError::LibraryDoesNotContainEntry(e)),