mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-19 19:40:56 +00:00
Fix STM32 build
This commit is contained in:
1 parent
b7ce8213d7
commit
76865cbe14
2 files changed
+11
-2
No files matched your search
+6
-1
@@ -2862,6 +2862,10 @@ typedef int SOCKET;
|
|||||||
#define MSG_NONBLOCKING 0
|
#define MSG_NONBLOCKING 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef AF_INET6
|
||||||
|
#define AF_INET6 10
|
||||||
|
#endif
|
||||||
|
|
||||||
union usa {
|
union usa {
|
||||||
struct sockaddr sa;
|
struct sockaddr sa;
|
||||||
struct sockaddr_in sin;
|
struct sockaddr_in sin;
|
||||||
@@ -3220,7 +3224,8 @@ static bool mg_socketpair(SOCKET sp[2], union usa usa[2]) {
|
|||||||
|
|
||||||
(void) memset(&usa[0], 0, sizeof(usa[0]));
|
(void) memset(&usa[0], 0, sizeof(usa[0]));
|
||||||
usa[0].sin.sin_family = AF_INET;
|
usa[0].sin.sin_family = AF_INET;
|
||||||
usa[0].sin.sin_addr.s_addr = htonl(0x7f000001); // 127.0.0.1
|
// usa[0].sin.sin_addr.s_addr = mg_htonl(0x7f000001); // 127.0.0.1
|
||||||
|
*(uint32_t *) &usa->sin.sin_addr = mg_htonl(0x7f000001); // 127.0.0.1
|
||||||
usa[1] = usa[0];
|
usa[1] = usa[0];
|
||||||
|
|
||||||
if ((sp[0] = socket(AF_INET, SOCK_DGRAM, 0)) != INVALID_SOCKET &&
|
if ((sp[0] = socket(AF_INET, SOCK_DGRAM, 0)) != INVALID_SOCKET &&
|
||||||
|
|||||||
+5
-1
@@ -35,6 +35,10 @@ typedef int SOCKET;
|
|||||||
#define MSG_NONBLOCKING 0
|
#define MSG_NONBLOCKING 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef AF_INET6
|
||||||
|
#define AF_INET6 10
|
||||||
|
#endif
|
||||||
|
|
||||||
union usa {
|
union usa {
|
||||||
struct sockaddr sa;
|
struct sockaddr sa;
|
||||||
struct sockaddr_in sin;
|
struct sockaddr_in sin;
|
||||||
@@ -393,7 +397,7 @@ static bool mg_socketpair(SOCKET sp[2], union usa usa[2]) {
|
|||||||
|
|
||||||
(void) memset(&usa[0], 0, sizeof(usa[0]));
|
(void) memset(&usa[0], 0, sizeof(usa[0]));
|
||||||
usa[0].sin.sin_family = AF_INET;
|
usa[0].sin.sin_family = AF_INET;
|
||||||
usa[0].sin.sin_addr.s_addr = htonl(0x7f000001); // 127.0.0.1
|
*(uint32_t *) &usa->sin.sin_addr = mg_htonl(0x7f000001); // 127.0.0.1
|
||||||
usa[1] = usa[0];
|
usa[1] = usa[0];
|
||||||
|
|
||||||
if ((sp[0] = socket(AF_INET, SOCK_DGRAM, 0)) != INVALID_SOCKET &&
|
if ((sp[0] = socket(AF_INET, SOCK_DGRAM, 0)) != INVALID_SOCKET &&
|
||||||
|
|||||||
Reference in new issue
Block a user