Complete Haiku platform support. (#10311)

Fixing linkage/libraries missing issue.
Implements missing platform specifics.
This commit is contained in:
David CARLIER 2020-08-23 14:39:32 +01:00 committed by GitHub
parent 98faeac5a7
commit cf5547227d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 24 additions and 5 deletions

View File

@ -351,6 +351,10 @@ else()
if (ICONV_LIBRARY) if (ICONV_LIBRARY)
set(PLATFORM_LIBS ${PLATFORM_LIBS} ${ICONV_LIBRARY}) set(PLATFORM_LIBS ${PLATFORM_LIBS} ${ICONV_LIBRARY})
endif() endif()
if (HAIKU)
set(PLATFORM_LIBS ${PLATFORM_LIBS} intl network)
endif()
endif() endif()
check_include_files(endian.h HAVE_ENDIAN_H) check_include_files(endian.h HAVE_ENDIAN_H)

View File

@ -16,8 +16,3 @@ if (BUILD_CLIENT)
PARENT_SCOPE PARENT_SCOPE
) )
endif() endif()
# Haiku networking support
if(HAIKU)
set(PLATFORM_LIBS -lnetwork ${PLATFORM_LIBS})
endif()

View File

@ -56,6 +56,10 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include <crt_externs.h> #include <crt_externs.h>
#endif #endif
#if defined(__HAIKU__)
#include <FindDirectory.h>
#endif
#include "config.h" #include "config.h"
#include "debug.h" #include "debug.h"
#include "filesys.h" #include "filesys.h"
@ -321,6 +325,12 @@ bool getCurrentExecPath(char *buf, size_t len)
return true; return true;
} }
#elif defined(__HAIKU__)
bool getCurrentExecPath(char *buf, size_t len)
{
return find_path(B_APP_IMAGE_SYMBOL, B_FIND_PATH_IMAGE_PATH, NULL, buf, len) == B_OK;
}
//// Solaris //// Solaris
#elif defined(__sun) || defined(sun) #elif defined(__sun) || defined(sun)

View File

@ -309,6 +309,8 @@ inline const char *getPlatformName()
#else #else
"SunOS" "SunOS"
#endif #endif
#elif defined(__HAIKU__)
"Haiku"
#elif defined(__CYGWIN__) #elif defined(__CYGWIN__)
"Cygwin" "Cygwin"
#elif defined(__unix__) || defined(__unix) #elif defined(__unix__) || defined(__unix)

View File

@ -225,6 +225,10 @@ void Thread::setName(const std::string &name)
pthread_setname_np(name.c_str()); pthread_setname_np(name.c_str());
#elif defined(__HAIKU__)
rename_thread(find_thread(NULL), name.c_str());
#elif defined(_MSC_VER) #elif defined(_MSC_VER)
// Windows itself doesn't support thread names, // Windows itself doesn't support thread names,

View File

@ -36,6 +36,10 @@ DEALINGS IN THE SOFTWARE.
#include <sys/thread.h> // for tid_t #include <sys/thread.h> // for tid_t
#endif #endif
#ifdef __HAIKU__
#include <kernel/OS.h>
#endif
/* /*
* On platforms using pthreads, these five priority classes correlate to * On platforms using pthreads, these five priority classes correlate to
* even divisions between the minimum and maximum reported thread priority. * even divisions between the minimum and maximum reported thread priority.