-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Am 2014-10-12 18:38, schrieb Ken Thomases:
It should work to make the long_name and short_name fields arrays instead of pointers, although that brings back the use of fixed lengths.
The other approach is to define the strings like:
static const WCHAR short_name_HKLM[] = {'H','K','L','M',0};
Those are the two of the three options I found. The third suggestion I found was to cast the initializer to a const WCHAR [], like this (just using char here for testing outside of wine):
static const struct { const char *foo; int bar; } test[] = { {(const char []){'a', 'b', 'c', 0}, 5}, };
But that seems to be a C99 feature (http://gcc.gnu.org/onlinedocs/gcc/Compound-Literals.html).
The other thing I noticed is that even my big fat C/C++ book is completely clueless about this and (somewhat relatedly) initializes a (non-const) char * with a string literal and later sprintf()s to it.