1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-09 00:00:04 +01:00

freertos: forward-port lwip version adaptations

This commit is contained in:
Andy Green 2020-03-04 06:24:09 +00:00
parent c25c37febd
commit 0e94683897
2 changed files with 12 additions and 8 deletions

View file

@ -1,7 +1,7 @@
/*
* libwebsockets - small server side websockets and web server implementation
*
* Copyright (C) 2010 - 2019 Andy Green <andy@warmcat.com>
* Copyright (C) 2010 - 2020 Andy Green <andy@warmcat.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
@ -27,6 +27,13 @@
typedef int lws_sockfd_type;
typedef int lws_filefd_type;
#if defined(LWS_AMAZON_RTOS)
#include <FreeRTOS.h>
#include <event_groups.h>
#include <string.h>
#include "timers.h"
#include <lwip/sockets.h>
/*
* Later lwip (at least 2.1.12) already defines these in its own headers
* protected by the same test as used here... if POLLIN / POLLOUT already exist
@ -51,12 +58,6 @@ struct pollfd {
#endif
#if defined(LWS_AMAZON_RTOS)
#include <FreeRTOS.h>
#include <event_groups.h>
#include <string.h>
#include "timers.h"
#include <lwip/sockets.h>
#else /* LWS_AMAZON_RTOS */
#include <freertos/FreeRTOS.h>
#include <freertos/event_groups.h>

View file

@ -24,7 +24,6 @@
* Included from lib/private-lib-core.h if LWS_PLAT_FREERTOS
*/
#define MSG_NOSIGNAL 0
#define SOMAXCONN 3
#if defined(LWS_AMAZON_RTOS)
@ -95,6 +94,10 @@ gai_strerror(int);
#endif
#endif
#if !defined(MSG_NOSIGNAL)
#define MSG_NOSIGNAL 0
#endif
#define compatible_close(x) close(x)
#define lws_plat_socket_offset() LWIP_SOCKET_OFFSET
#define wsi_from_fd(A,B) A->lws_lookup[B - lws_plat_socket_offset()]