mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-09 00:00:04 +01:00
win32: remove snprintf mangling
Everything in lws outside esp32 was changed to use lws_snprintf() a while ago. This fixes a couple of stragglers and removes the preprocessor mangling.
This commit is contained in:
parent
7f830195d6
commit
cb70b6e633
3 changed files with 4 additions and 12 deletions
|
@ -95,18 +95,10 @@ typedef unsigned long long lws_intptr_t;
|
|||
#define LWS_O_CREAT _O_CREAT
|
||||
#define LWS_O_TRUNC _O_TRUNC
|
||||
|
||||
#if !defined(__MINGW32__) && (!defined(_MSC_VER) || _MSC_VER < 1900) /* Visual Studio 2015 already defines this in <stdio.h> */
|
||||
#define lws_snprintf _snprintf
|
||||
#endif
|
||||
|
||||
#ifndef __func__
|
||||
#define __func__ __FUNCTION__
|
||||
#endif
|
||||
|
||||
#if !defined(__MINGW32__) &&(!defined(_MSC_VER) || _MSC_VER < 1900) && !defined(snprintf)
|
||||
#define snprintf(buf,len, format,...) _snprintf_s(buf, len,len, format, __VA_ARGS__)
|
||||
#endif
|
||||
|
||||
#else /* NOT WIN32 */
|
||||
#include <unistd.h>
|
||||
#if defined(LWS_HAVE_SYS_CAPABILITY_H) && defined(LWS_HAVE_LIBCAP)
|
||||
|
|
|
@ -335,12 +335,12 @@ ssh_ops_shell(void *_priv, struct lws *wsi, lws_ssh_finish_exec finish, void *fi
|
|||
static size_t
|
||||
ssh_ops_banner(char *buf, size_t max_len, char *lang, size_t max_lang_len)
|
||||
{
|
||||
int n = snprintf(buf, max_len, "\n"
|
||||
int n = lws_snprintf(buf, max_len, "\n"
|
||||
" |\\---/| lws-ssh Test Server\n"
|
||||
" | o_o | SSH Terminal Server\n"
|
||||
" \\_^_/ Copyright (C) 2017 Crash Barrier Ltd\n\n");
|
||||
|
||||
snprintf(lang, max_lang_len, "en/US");
|
||||
lws_snprintf(lang, max_lang_len, "en/US");
|
||||
|
||||
return n;
|
||||
}
|
||||
|
|
|
@ -578,12 +578,12 @@ ssh_ops_shell(void *_priv, struct lws *wsi, lws_ssh_finish_exec finish, void *fi
|
|||
static size_t
|
||||
ssh_ops_banner(char *buf, size_t max_len, char *lang, size_t max_lang_len)
|
||||
{
|
||||
int n = snprintf(buf, max_len, "\n"
|
||||
int n = lws_snprintf(buf, max_len, "\n"
|
||||
" |\\---/| lws-ssh Test Server\n"
|
||||
" | o_o | SSH Terminal Server\n"
|
||||
" \\_^_/ Copyright (C) 2017 Crash Barrier Ltd\n\n");
|
||||
|
||||
snprintf(lang, max_lang_len, "en/US");
|
||||
lws_snprintf(lang, max_lang_len, "en/US");
|
||||
|
||||
return n;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue