Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix SKIP_ACE=ON option for macOS #2934

Merged
merged 2 commits into from
Jan 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/libYARP_os/src/yarp/os/Os.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ int yarp::os::fork()
{
# if defined(YARP_HAS_ACE)
pid_t pid = ACE_OS::fork();
# elif defined(__unix__)
# elif defined(__unix__) || defined(__APPLE__)
pid_t pid = ::fork();
# else
YARP_COMPILER_ERROR(Cannot implement fork on this platform)
Expand Down
4 changes: 2 additions & 2 deletions src/libYARP_os/src/yarp/os/impl/NameConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
# ifdef main
# undef main
# endif
#elif defined(__unix__)
#elif defined(__unix__) || defined(__APPLE__)
# include <arpa/inet.h>
# include <cstring>
# include <sys/socket.h>
Expand Down Expand Up @@ -334,7 +334,7 @@ bool NameConfig::isLocalName(const std::string& name)
}
delete[] ips;
}
#elif defined(__unix__)
#elif defined(__unix__) || defined(__APPLE__)
/**
* If this does not work properly, use a more sophisticated way
* instead of just gethostname.
Expand Down
2 changes: 1 addition & 1 deletion src/libYARP_os/src/yarp/os/impl/SocketTwoWayStream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
# ifdef main
# undef main
# endif
#elif (__unix__)
#elif defined(__unix__) || defined(__APPLE__)
# include <netinet/tcp.h>
#endif

Expand Down
4 changes: 2 additions & 2 deletions src/libYARP_os/src/yarp/os/impl/TcpAcceptor.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# ifdef main
# undef main
# endif
#elif defined(__unix__)
#elif defined(__unix__) || defined(__APPLE__)
# include <yarp/os/impl/posix/TcpAcceptor.h>
#else
YARP_COMPILER_ERROR(Cannot implement TcpAcceptor on this platform)
Expand All @@ -23,7 +23,7 @@ namespace yarp::os::impl {

#ifdef YARP_HAS_ACE
typedef ACE_SOCK_Acceptor TcpAcceptor;
#elif defined(__unix__)
#elif defined(__unix__) || defined(__APPLE__)
typedef yarp::os::impl::posix::TcpAcceptor TcpAcceptor;
#endif

Expand Down
4 changes: 2 additions & 2 deletions src/libYARP_os/src/yarp/os/impl/TcpConnector.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# ifdef main
# undef main
# endif
#elif defined(__unix__)
#elif defined(__unix__) || defined(__APPLE__)
# include <yarp/os/impl/posix/TcpConnector.h>
#else
YARP_COMPILER_ERROR(Cannot implement TcpConnector on this platform)
Expand All @@ -23,7 +23,7 @@ namespace yarp::os::impl {

#ifdef YARP_HAS_ACE
typedef ACE_SOCK_Connector TcpConnector;
#elif defined(__unix__)
#elif defined(__unix__) || defined(__APPLE__)
typedef yarp::os::impl::posix::TcpConnector TcpConnector;
#endif

Expand Down
4 changes: 2 additions & 2 deletions src/libYARP_os/src/yarp/os/impl/TcpStream.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# ifdef main
# undef main
# endif
#elif defined(__unix__)
#elif defined(__unix__) || defined(__APPLE__)
# include <yarp/os/impl/posix/TcpStream.h>
#else
YARP_COMPILER_ERROR(Cannot implement TcpStream on this platform)
Expand All @@ -23,7 +23,7 @@ namespace yarp::os::impl {

#ifdef YARP_HAS_ACE
typedef ACE_SOCK_Stream TcpStream;
#elif defined(__unix__)
#elif defined(__unix__) || defined(__APPLE__)
typedef yarp::os::impl::posix::TcpStream TcpStream;
#endif

Expand Down
6 changes: 3 additions & 3 deletions src/libYARP_os/src/yarp/os/impl/ThreadImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ int ThreadImpl::setPriority(int priority, int policy)
return ACE_Thread::setprio(thread.native_handle(), priority, policy);
}
yCError(THREADIMPL, "Cannot set priority without ACE");
#elif defined(__unix__)
#elif defined(__unix__) || defined(__APPLE__)
if (std::is_same<std::thread::native_handle_type, pthread_t>::value) {
struct sched_param thread_param;
thread_param.sched_priority = priority;
Expand All @@ -284,7 +284,7 @@ int ThreadImpl::getPriority()
} else {
yCError(THREADIMPL, "Cannot get priority without ACE");
}
#elif defined(__unix__)
#elif defined(__unix__) || defined(__APPLE__)
if (std::is_same<std::thread::native_handle_type, pthread_t>::value) {
struct sched_param thread_param;
int policy;
Expand Down Expand Up @@ -312,7 +312,7 @@ int ThreadImpl::getPolicy()
} else {
yCError(THREADIMPL, "Cannot get scheduling policy without ACE");
}
#elif defined(__unix__)
#elif defined(__unix__) || defined(__APPLE__)
if (std::is_same<std::thread::native_handle_type, pthread_t>::value) {
struct sched_param thread_param;
if (pthread_getschedparam(thread.native_handle(), &policy, &thread_param) != 0) {
Expand Down
2 changes: 1 addition & 1 deletion src/yarpidl_rosmsg/src/RosType.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,7 @@ bool RosTypeSearch::fetchFromRos(const std::string& target_file,
# else
using ACE_OS::execlp;
# endif
#elif defined(__unix__)
#elif defined(__unix__) || defined(__APPLE__)
using ::fork;
using ::execlp;
#endif
Expand Down