utf16_literal 0.2.1

Provides the u16! macro that emits a UTF-16 string literal
Documentation
  • Coverage
  • 100%
    2 out of 2 items documented1 out of 2 items with examples
  • Size
  • Source code size: 5.72 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 251.68 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 3s Average build duration of successful builds.
  • all releases: 3s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • thepowersgang/utf16_literal-rs
    11 1 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • thepowersgang

A rust prodedural macro that creates UTF-16 encoded literals (as &[u16; N])

#[macro_use]
extern crate utf16_literal;

extern "system" {
    fn MessageBoxW(*const (), *const u16, *const u16)
}

fn main() {
    let title = u16!("Rust Code\0");
    let msg = u16!("Hello World\0");
    unsafe {
        MessageBoxW(::std::ptr::null(), msg, title, 0);
    }
}