Skip to content

Commit

Permalink
Build: add Solaris compilation support (#282)
Browse files Browse the repository at this point in the history
  • Loading branch information
jengelh authored Nov 9, 2023
1 parent c6b9ad3 commit 1a35bb6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -845,6 +845,7 @@ CHECK_FUNCTION_EXISTS(gettid VMIME_HAVE_GETTID)
CHECK_FUNCTION_EXISTS(syscall VMIME_HAVE_SYSCALL)
CHECK_SYMBOL_EXISTS(SYS_gettid sys/syscall.h VMIME_HAVE_SYSCALL_GETTID)
CHECK_SYMBOL_EXISTS(getthrid unistd.h VMIME_HAVE_GETTHRID)
CHECK_SYMBOL_EXISTS(_lwp_self sys/lwp.h VMIME_HAVE_LWP_SELF)

CHECK_SYMBOL_EXISTS(SO_KEEPALIVE sys/socket.h VMIME_HAVE_SO_KEEPALIVE)
CHECK_SYMBOL_EXISTS(SO_NOSIGPIPE sys/socket.h VMIME_HAVE_SO_NOSIGPIPE)
Expand Down
1 change: 1 addition & 0 deletions cmake/config.hpp.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ typedef unsigned @VMIME_64BIT_TYPE@ vmime_uint64;
#cmakedefine01 VMIME_HAVE_SYSCALL
#cmakedefine01 VMIME_HAVE_SYSCALL_GETTID
#cmakedefine01 VMIME_HAVE_GETTHRID
#cmakedefine01 VMIME_HAVE_LWP_SELF
#cmakedefine01 VMIME_HAVE_GMTIME_S
#cmakedefine01 VMIME_HAVE_GMTIME_R
#cmakedefine01 VMIME_HAVE_LOCALTIME_S
Expand Down
5 changes: 5 additions & 0 deletions src/vmime/platforms/posix/posixHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@
#if VMIME_HAVE_SYSCALL
# include <sys/syscall.h>
#endif
#if VMIME_HAVE_LWP_SELF
# include <sys/lwp.h>
#endif

#include <netdb.h>

Expand Down Expand Up @@ -227,6 +230,8 @@ unsigned int posixHandler::getThreadId() const {
return static_cast <unsigned int>(::syscall(SYS_gettid));
#elif VMIME_HAVE_GETTHRID // OpenBSD
return static_cast <unsigned int>(::getthrid());
#elif VMIME_HAVE_LWP_SELF // Solaris
return static_cast <unsigned int>(::_lwp_self());
#else
#error We have no implementation of getThreadId() for this platform!
#endif
Expand Down

0 comments on commit 1a35bb6

Please sign in to comment.