Skip to content

standalone_sys should support string constants #2499

@Jake-Shadle

Description

@Jake-Shadle

Which crate is this about?

windows-bindgen

Crate version

0.49.0

Summary

When binding string constants there are 2 issues.

  1. String constants are Type::String, which gets resolved to HSTRING, and while it's unlikely, if you don't bind another item that pulls in PCSTR or PCWSTR (the string types that Type::String constants actually get resolved to) then there will be a missing typedef.
  2. String constants unconditionally assume that the s! and w! macros are available.

Toolchain version/configuration

No response

Reproducible example

No response

Crate manifest

No response

Expected behavior

The emitted string constants should compile correctly.

Actual behavior

The emitted constants will fail to compile due to the unknown s! or w! macro(s), and possibly due to missing the type aliases for PCSTR and/or PCWSTR.

Additional comments

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions