The current definition of "ticket context" in picotls.h uses an unsupported construct:
uint8_t is_set : 1;
This creates a fatal error when picotls.h is included in applications compiled in Visual Studio, like in this run of picoquic:
4>c:\projects\picotls\include\picotls.h(989): error C2220: warning treated as error - no 'object' file generated [C:\projects\picoquic\picohttp\picohttp.vcxproj]
4>c:\projects\picotls\include\picotls.h(989): warning C4214: nonstandard extension used: bit field types other than int [C:\projects\picoquic\picohttp\picohttp.vcxproj]
Changing to:
/**
* (optional) session ID Context to segment resumption
*/
struct {
uint8_t bytes[PTLS_SHA256_DIGEST_SIZE];
#ifdef _WINDOWS
unsigned int is_set : 1;
#else
uint8_t is_set : 1;
#endif
} ticket_context;
Note that on Windows compilers, "unsigned int is_set : 1;" occupies a single byte, so there is no cost to that typing.
I also needed to remove a stray character that somehow made it into mbedtls.c.
@kazuho I have accepted your changes. I considered that too, but I was wondering whether there was some good reason for the uint8_t. Will merge the PR once the CI tests have passed.
The current definition of "ticket context" in
picotls.h
uses an unsupported construct:This creates a fatal error when
picotls.h
is included in applications compiled in Visual Studio, like in this run of picoquic:Changing to:
Note that on Windows compilers, "unsigned int is_set : 1;" occupies a single byte, so there is no cost to that typing.
I also needed to remove a stray character that somehow made it into mbedtls.c.