Opened 5 years ago

Last modified 4 years ago

#13431 new Bugs

ncurses.h and boost.asio problem

Reported by: Adrian Rapiteanu <adrian.rapiteanu@…> Owned by: chris_kohlhoff
Milestone: To Be Determined Component: asio
Version: Boost 1.66.0 Severity: Problem
Keywords: ncurses.h and boost.asio Cc:

Description

Hi, I got the latest boost library (1.66) and tried to compile my old project. The file that I have the errors has #include <ncurses.h> I get a bunch of errors related to timeout() call. To reproduce:

#include <boost/asio.hpp> #include <ncurses.h>

/boost_release_1_66/include/boost/asio/basic_socket_streambuf.hpp:586:7: error: ‘stdscr’ is not a type

int timeout() const

Looking to the history I see that it was a similar issue but was fixed, and now in the latest release this issue is back.

Change History (2)

comment:1 by saszasta@…, 5 years ago

I also have this exact problem.

boost 1.66.0-1; ncurses 6.1-3

In file included from test_controller.cpp:2:0:
/usr/include/boost/asio/basic_socket_streambuf.hpp:586:7: error: ‘stdscr’ is not a type
   int timeout() const
       ^
/usr/include/boost/asio/basic_socket_streambuf.hpp:586:7: error: expected identifier before ‘(’ token
   int timeout() const
       ^
/usr/include/boost/asio/basic_socket_streambuf.hpp: In member function ‘std::basic_streambuf<char>::int_type boost::asio::basic_socket_streambuf<Protocol, Clock, WaitTraits>::underflow()’:
/usr/include/boost/asio/basic_socket_streambuf.hpp:470:42: error: expected primary-expression before ‘)’ token
             socket().native_handle(), 0, timeout(), ec_) < 0)
                                          ^
/usr/include/boost/asio/basic_socket_streambuf.hpp: In member function ‘std::basic_streambuf<char>::int_type boost::asio::basic_socket_streambuf<Protocol, Clock, WaitTraits>::overflow(std::basic_streambuf<char>::int_type)’:
/usr/include/boost/asio/basic_socket_streambuf.hpp:529:42: error: expected primary-expression before ‘)’ token
             socket().native_handle(), 0, timeout(), ec_) < 0)
                                          ^
/usr/include/boost/asio/basic_socket_streambuf.hpp: In member function ‘void boost::asio::basic_socket_streambuf<Protocol, Clock, WaitTraits>::connect_to_endpoints(EndpointIterator, EndpointIterator)’:
/usr/include/boost/asio/basic_socket_streambuf.hpp:647:39: error: expected primary-expression before ‘)’ token
             socket().native_handle(), timeout(), ec_) < 0)
                                       ^

comment:2 by lebed.dmitry@…, 4 years ago

Same issue for me (gcc 8.1.0, boost 1.66.0-2):

/usr/include/boost/asio/basic_socket_streambuf.hpp:586:7: error: 'stdscr' is not a type
   int timeout() const
       ^~~~~~~
/usr/include/boost/asio/basic_socket_streambuf.hpp:586:7: error: expected identifier before '(' token
   int timeout() const
       ^~~~~~~
/usr/include/boost/asio/basic_socket_streambuf.hpp: In member function 'std::basic_streambuf<char>::int_type boost::asio::basic_socket_streambuf<Protocol, Clock, WaitTraits>::underflow()':
/usr/include/boost/asio/basic_socket_streambuf.hpp:470:42: error: expected primary-expression before ')' token
             socket().native_handle(), 0, timeout(), ec_) < 0)
                                          ^~~~~~~
/usr/include/boost/asio/basic_socket_streambuf.hpp: In member function 'std::basic_streambuf<char>::int_type boost::asio::basic_socket_streambuf<Protocol, Clock, WaitTraits>::overflow(std::basic_streambuf<char>::int_type)':
/usr/include/boost/asio/basic_socket_streambuf.hpp:529:42: error: expected primary-expression before ')' token
             socket().native_handle(), 0, timeout(), ec_) < 0)
                                          ^~~~~~~
/usr/include/boost/asio/basic_socket_streambuf.hpp: In member function 'void boost::asio::basic_socket_streambuf<Protocol, Clock, WaitTraits>::connect_to_endpoints(EndpointIterator, EndpointIterator)':
/usr/include/boost/asio/basic_socket_streambuf.hpp:647:39: error: expected primary-expression before ')' token
             socket().native_handle(), timeout(), ec_) < 0)
Note: See TracTickets for help on using tickets.