Skip to content

Added system_error header to SockerProactor for std::error_code#3883

Merged
aleks-f merged 1 commit intopocoproject:poco-1.12.5from
ccarrasc:error_code_import
Mar 18, 2023
Merged

Added system_error header to SockerProactor for std::error_code#3883
aleks-f merged 1 commit intopocoproject:poco-1.12.5from
ccarrasc:error_code_import

Conversation

@ccarrasc
Copy link
Copy Markdown
Contributor

When compiling with an older arm gnu compiler (gcc-linaro-4.9-2016.02-x86_64_arm-linux-gnueabihf), we get the following error:

In file included from poco/Net/src/SocketProactor.cpp:15:0:
poco/Net/include/Poco/Net/SocketProactor.h:62:50: error: 'error_code' in namespace 'std' does not name a type
  using Callback = std::function<void (const std::error_code& failure, int bytesReceived)>;
                                                  ^
poco/Net/include/Poco/Net/SocketProactor.h:62:90: error: expected '::' before ';' token
  using Callback = std::function<void (const std::error_code& failure, int bytesReceived)>;
                                                                                          ^
poco/Net/include/Poco/Net/SocketProactor.h:62:90: error: expected identifier before ';' token
poco/Net/include/Poco/Net/SocketProactor.h:168:69: error: 'Callback' has not been declared
  void addReceiveFrom(Socket sock, Buffer& buf, SocketAddress& addr, Callback&& onCompletion);
                                                                     ^
poco/Net/include/Poco/Net/SocketProactor.h:171:80: error: 'Callback' has not been declared
  void addSendTo(Socket sock, const Buffer& message, const SocketAddress& addr, Callback&& onCompletion);
                                                                                ^
poco/Net/include/Poco/Net/SocketProactor.h:174:76: error: 'Callback' has not been declared
  void addSendTo(Socket sock, Buffer&& message, const SocketAddress&& addr, Callback&& onCompletion);
                                                                            ^
poco/Net/include/Poco/Net/SocketProactor.h:177:68: error: 'Callback' has not been declared
  void addSend(Socket sock, Buffer* pMessage, SocketAddress* pAddr, Callback&& onCompletion, bool own = false);
                                                                    ^
poco/Net/include/Poco/Net/SocketProactor.h:182:44: error: 'Callback' has not been declared
  void addReceive(Socket sock, Buffer& buf, Callback&& onCompletion);
                                            ^
poco/Net/include/Poco/Net/SocketProactor.h:185:51: error: 'Callback' has not been declared
  void addSend(Socket sock, const Buffer& message, Callback&& onCompletion);
                                                   ^
poco/Net/include/Poco/Net/SocketProactor.h:188:46: error: 'Callback' has not been declared
  void addSend(Socket sock, Buffer&& message, Callback&& onCompletion);
                                              ^
poco/Net/include/Poco/Net/SocketProactor.h:227:3: error: 'Callback' does not name a type
   Callback _onCompletion = nullptr;
   ^
poco/Net/include/Poco/Net/SocketProactor.h:239:26: error: expected ')' before '&&' token
   IONotification(Callback&& onCompletion, int bytes, const std::error_code& errorCode):
                          ^
poco/Net/include/Poco/Net/SocketProactor.h:256:3: error: 'Callback' does not name a type
   Callback _onCompletion;
   ^
poco/Net/include/Poco/Net/SocketProactor.h:258:8: error: 'error_code' in namespace 'std' does not name a type
   std::error_code _errorCode;
        ^
poco/Net/include/Poco/Net/SocketProactor.h:436:29: error: 'Callback' has not been declared
  void enqueueIONotification(Callback&& onCompletion, int n, int err);
                             ^
poco/Net/include/Poco/Net/SocketProactor.h: In member function 'void Poco::Net::SocketProactor::IONotification::call()':
poco/Net/include/Poco/Net/SocketProactor.h:252:18: error: '_errorCode' was not declared in this scope
    _onCompletion(_errorCode, _bytes);
                  ^
poco/Net/include/Poco/Net/SocketProactor.h:252:36: error: '_onCompletion' was not declared in this scope
    _onCompletion(_errorCode, _bytes);
                                    ^
poco/Net/include/Poco/Net/SocketProactor.h: In member function 'int Poco::Net::SocketProactor::errorImpl(Poco::Net::Socket&, T&, Poco::Mutex&)':
poco/Net/include/Poco/Net/SocketProactor.h:397:43: error: 'struct Poco::Net::SocketProactor::Handler' has no member named '_onCompletion'
    enqueueIONotification(std::move((*it)->_onCompletion), 0, err);
                                           ^
poco/Net/include/Poco/Net/SocketProactor.h: At global scope:
poco/Net/include/Poco/Net/SocketProactor.h:482:51: error: variable or field 'enqueueIONotification' declared void
 inline void SocketProactor::enqueueIONotification(Callback&& onCompletion, int n, int err)
                                                   ^
poco/Net/include/Poco/Net/SocketProactor.h:482:51: error: 'Callback' was not declared in this scope
poco/Net/include/Poco/Net/SocketProactor.h:482:62: error: 'onCompletion' was not declared in this scope
 inline void SocketProactor::enqueueIONotification(Callback&& onCompletion, int n, int err)
                                                              ^
poco/Net/include/Poco/Net/SocketProactor.h:482:76: error: expected primary-expression before 'int'
 inline void SocketProactor::enqueueIONotification(Callback&& onCompletion, int n, int err)
                                                                            ^
poco/Net/include/Poco/Net/SocketProactor.h:482:83: error: expected primary-expression before 'int'
 inline void SocketProactor::enqueueIONotification(Callback&& onCompletion, int n, int err)
                                                                                   ^
poco/Net/src/SocketProactor.cpp:808:3: error: expected '}' at end of input
 } } // namespace Poco::Net
   ^
poco/Net/src/SocketProactor.cpp:808:3: error: expected '}' at end of input

Adding the missing the system_error header clears these errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants