Skip to content

Commit

Permalink
Merge branch 'idf' into 'master'
Browse files Browse the repository at this point in the history
esp-idf support in asio

See merge request idf/asio!1
  • Loading branch information
projectgus committed Jul 17, 2018
2 parents b0926b6 + 9cd75ff commit 55efc17
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 7 deletions.
4 changes: 4 additions & 0 deletions asio/include/asio.hpp
Expand Up @@ -15,6 +15,10 @@
# pragma once
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)

#if defined(ESP_PLATFORM)
# include "esp_asio_config.h"
#endif // defined(ESP_PLATFORM)

#include "asio/associated_allocator.hpp"
#include "asio/associated_executor.hpp"
#include "asio/async_result.hpp"
Expand Down
4 changes: 4 additions & 0 deletions asio/include/asio/detail/config.hpp
Expand Up @@ -11,6 +11,10 @@
#ifndef ASIO_DETAIL_CONFIG_HPP
#define ASIO_DETAIL_CONFIG_HPP

#if defined(ESP_PLATFORM)
# include "esp_asio_config.h"
#endif // defined(ESP_PLATFORM)

#if defined(ASIO_STANDALONE)
# define ASIO_DISABLE_BOOST_ARRAY 1
# define ASIO_DISABLE_BOOST_ASSERT 1
Expand Down
4 changes: 4 additions & 0 deletions asio/include/asio/detail/impl/null_event.ipp
Expand Up @@ -42,6 +42,10 @@ void null_event::do_wait()
std::this_thread::sleep_until((std::chrono::steady_clock::time_point::max)());
#elif defined(ASIO_WINDOWS) || defined(__CYGWIN__)
::Sleep(INFINITE);
#elif defined (ESP_PLATFORM)
while (true) {
::sleep(UINT_MAX);
}
#else
::pause();
#endif
Expand Down
5 changes: 3 additions & 2 deletions asio/include/asio/detail/impl/socket_ops.ipp
Expand Up @@ -560,7 +560,8 @@ bool non_blocking_connect(socket_type s, asio::error_code& ec)
// get spurious readiness notifications from the reactor.
#if defined(ASIO_WINDOWS) \
|| defined(__CYGWIN__) \
|| defined(__SYMBIAN32__)
|| defined(__SYMBIAN32__) \
|| defined(ESP_PLATFORM)
fd_set write_fds;
FD_ZERO(&write_fds);
FD_SET(s, &write_fds);
Expand Down Expand Up @@ -609,7 +610,7 @@ bool non_blocking_connect(socket_type s, asio::error_code& ec)
int socketpair(int af, int type, int protocol,
socket_type sv[2], asio::error_code& ec)
{
#if defined(ASIO_WINDOWS) || defined(__CYGWIN__)
#if defined(ASIO_WINDOWS) || defined(__CYGWIN__) || defined (ESP_PLATFORM)
(void)(af);
(void)(type);
(void)(protocol);
Expand Down
3 changes: 2 additions & 1 deletion asio/include/asio/detail/impl/socket_select_interrupter.ipp
Expand Up @@ -21,7 +21,8 @@

#if defined(ASIO_WINDOWS) \
|| defined(__CYGWIN__) \
|| defined(__SYMBIAN32__)
|| defined(__SYMBIAN32__) \
|| defined(ESP_PLATFORM)

#include <cstdlib>
#include "asio/detail/socket_holder.hpp"
Expand Down
4 changes: 2 additions & 2 deletions asio/include/asio/detail/select_interrupter.hpp
Expand Up @@ -19,7 +19,7 @@

#if !defined(ASIO_WINDOWS_RUNTIME)

#if defined(ASIO_WINDOWS) || defined(__CYGWIN__) || defined(__SYMBIAN32__)
#if defined(ASIO_WINDOWS) || defined(__CYGWIN__) || defined(__SYMBIAN32__) || defined (ESP_PLATFORM)
# include "asio/detail/socket_select_interrupter.hpp"
#elif defined(ASIO_HAS_EVENTFD)
# include "asio/detail/eventfd_select_interrupter.hpp"
Expand All @@ -30,7 +30,7 @@
namespace asio {
namespace detail {

#if defined(ASIO_WINDOWS) || defined(__CYGWIN__) || defined(__SYMBIAN32__)
#if defined(ASIO_WINDOWS) || defined(__CYGWIN__) || defined(__SYMBIAN32__) || defined (ESP_PLATFORM)
typedef socket_select_interrupter select_interrupter;
#elif defined(ASIO_HAS_EVENTFD)
typedef eventfd_select_interrupter select_interrupter;
Expand Down
3 changes: 2 additions & 1 deletion asio/include/asio/detail/socket_select_interrupter.hpp
Expand Up @@ -21,7 +21,8 @@

#if defined(ASIO_WINDOWS) \
|| defined(__CYGWIN__) \
|| defined(__SYMBIAN32__)
|| defined(__SYMBIAN32__) \
|| defined(ESP_PLATFORM)

#include "asio/detail/socket_types.hpp"

Expand Down
5 changes: 4 additions & 1 deletion asio/include/asio/detail/socket_types.hpp
Expand Up @@ -78,12 +78,15 @@
# include <sys/uio.h>
# include <sys/un.h>
# include <netinet/in.h>
# if !defined(__SYMBIAN32__)
# if !defined(__SYMBIAN32__) && !defined(ESP_PLATFORM)
# include <netinet/tcp.h>
# endif
# include <arpa/inet.h>
# include <netdb.h>
# include <net/if.h>
# if defined(ESP_PLATFORM)
# include "esp_exception.h"
# endif
# include <limits.h>
# if defined(__sun)
# include <sys/filio.h>
Expand Down
4 changes: 4 additions & 0 deletions asio/include/asio/error_code.hpp
Expand Up @@ -17,6 +17,10 @@

#include "asio/detail/config.hpp"

#ifdef ESP_PLATFORM
# include "lwip/sockets.h"
#endif

#if defined(ASIO_HAS_STD_SYSTEM_ERROR)
# include <system_error>
#else // defined(ASIO_HAS_STD_SYSTEM_ERROR)
Expand Down

0 comments on commit 55efc17

Please sign in to comment.