chriskohlhoff / asio

Asio C++ Library
http://think-async.com/Asio
4.98k stars 1.22k forks source link

Does asio support compile on qnx710 #1460

Closed Je2ry closed 7 months ago

Je2ry commented 7 months ago

Hi,i have questions on compile asio on qnx710. errors: /home/asio/asio/include/asio/detail/tss_ptr.hpp:29:3: error: #error Only Windows and POSIX are supported!

error Only Windows and POSIX are supported!

/home/asio/asio/include/asio/detail/signal_blocker.hpp:27:3: error: #error Only Windows and POSIX are supported!

error Only Windows and POSIX are supported!

^~~~~ I add add_definitions(-DASIO_HAS_PTHREADS) in my CMakeLists.txt to solve the first problem. I wonder whether it is right. Besides, how can i solve the second error. Does asion support compile on qnx710 and to build on qnx710,what should i do?

Je2ry commented 7 months ago

already done

yuzu-ogura commented 7 months ago

already done

Excuse me, I got the same error when cross compile asio repository. Could you tell how do you solve this question?

Je2ry commented 2 months ago

already done

Excuse me, I got the same error when cross compile asio repository. Could you tell how do you solve this question?

Sorry, I did not notice the message.

  1. add this macro
    if (TARGET_CPU STREQUAL "QNX710")
    add_definitions(-DASIO_HAS_PTHREADS)
    set(LIBS c socket)
    else()
    # set(LIBS pthread)
    endif()
  2. QNX deos not support SA_RESTART, so in socket_types.hpp refine related macro:
    # if defined(__QNX__)
    #  define ASIO_OS_DEF_SA_RESTART 0
    # else
    #  define ASIO_OS_DEF_SA_RESTART SA_RESTART
    # endif