mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-09 00:00:04 +01:00
windows: only conceal mode_t on windows
This commit is contained in:
parent
0ba8df6eb4
commit
4c8195df22
1 changed files with 10 additions and 0 deletions
|
@ -209,8 +209,18 @@ int lws_open(const char *__file, int __oflag, ...)
|
|||
|| ((__oflag & O_TMPFILE) == O_TMPFILE)
|
||||
#endif
|
||||
)
|
||||
#if defined(WIN32)
|
||||
/* last arg is really a mode_t. But windows... */
|
||||
n = open(__file, __oflag, va_arg(ap, uint32_t));
|
||||
#else
|
||||
/* ... and some other toolchains...
|
||||
*
|
||||
* error: second argument to 'va_arg' is of promotable type 'mode_t'
|
||||
* (aka 'unsigned short'); this va_arg has undefined behavior because
|
||||
* arguments will be promoted to 'int'
|
||||
*/
|
||||
n = open(__file, __oflag, va_arg(ap, unsigned int));
|
||||
#endif
|
||||
else
|
||||
n = open(__file, __oflag);
|
||||
va_end(ap);
|
||||
|
|
Loading…
Add table
Reference in a new issue