rikyoz / bit7z

A C++ static library offering a clean and simple interface to the 7-zip shared libraries.
https://rikyoz.github.io/bit7z
Mozilla Public License 2.0
602 stars 110 forks source link

[Feature Request]: Change the definition of `BIT7Z_STRING` #167

Closed 836454543 closed 9 months ago

836454543 commented 10 months ago

Feature description

If define BIT7Z_USE_NATIVE_STRING, the definition of BIT7Z_STRING is L##str. This can be problematic in some cases.

/* define a macro called `STR` */
#define STR "hello"

/* use `BIT7Z_STRING` with `STR` */
BIT7Z_STRING(STR);  /* equal to `LSTR`, however `L"hello"` is expected */

The following is a better way to define BIT7Z_STRING

#define _BIT7Z_STRING(str) L##str
#define BIT7Z_STRING(str) _BIT7Z_STRING(str)

Additional context

No response

Code of Conduct

rikyoz commented 9 months ago

Hi! I think it might be helpful for the users of bit7z, so I've just pushed a commit to the branch release/v4.0.0 that changes the definition of BIT7Z_STRING as you suggested.

Thanks for the suggestion!

rikyoz commented 9 months ago

Implemented in v4.0.0.