Skip to content

Commit 9ca7e76

Browse files
committed
Fix build error on ESP8266
1 parent ab9f8b5 commit 9ca7e76

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

ssl/os_port.h

+11-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ extern "C" {
6262

6363
#include "util/time.h"
6464
#include <errno.h>
65-
// #define alloca(size) __builtin_alloca(size)
65+
#define alloca(size) __builtin_alloca(size)
6666
#define TTY_FLUSH()
6767
#ifdef putc
6868
#undef putc
@@ -80,6 +80,7 @@ extern "C" {
8080
#define EWOULDBLOCK EAGAIN
8181

8282
#define hmac_sha1 ax_hmac_sha1
83+
#define hmac_sha256 ax_hmac_sha256
8384
#define hmac_md5 ax_hmac_md5
8485

8586
#ifndef be64toh
@@ -189,6 +190,15 @@ EXP_FUNC int STDCALL getdomainname(char *buf, int buf_size);
189190
#endif /* Not Win32 */
190191

191192
/* some functions to mutate the way these work */
193+
inline uint32_t htonl(uint32_t n){
194+
return ((n & 0xff) << 24) |
195+
((n & 0xff00) << 8) |
196+
((n & 0xff0000UL) >> 8) |
197+
((n & 0xff000000UL) >> 24);
198+
}
199+
200+
#define ntohl htonl
201+
192202
EXP_FUNC int STDCALL ax_open(const char *pathname, int flags);
193203

194204
#ifdef CONFIG_PLATFORM_LINUX

0 commit comments

Comments
 (0)