rust-samp 3.2.0

Write SA-MP and open.mp plugins in safe Rust instead of C++. A single binary runs natively on both servers, with proc macros (`#[native]`, `initialize_plugin!`) that hide the FFI boilerplate and ABI-correct marshalling for Linux (Itanium) and Windows (MSVC).
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//! Internal log macros with the SDK prefix.
//!
//! Avoids hardcoded `"[rust-samp]"` scattered across the crate — changing the
//! prefix in the future is a single edit in [`SDK_LOG_PREFIX`]. For now only
//! `sdk_warn!` is used; add `sdk_error!`/`sdk_info!` if a real need arises.

/// Prefix applied to all SDK log messages.
pub(crate) const SDK_LOG_PREFIX: &str = "[rust-samp]";

/// Equivalent to `log::warn!` but prepends [`SDK_LOG_PREFIX`].
macro_rules! sdk_warn {
    ($($arg:tt)*) => {
        log::warn!("{} {}", $crate::macros::SDK_LOG_PREFIX, format_args!($($arg)*))
    };
}

pub(crate) use sdk_warn;