mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 10:37:02 +00:00
[9449] Fixes for the Solaris platform.
Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
parent
c8e45058a6
commit
f40f564bd6
6 changed files with 50 additions and 3 deletions
|
|
@ -45,6 +45,8 @@
|
|||
#define G3D_LINUX
|
||||
#elif defined(__APPLE__)
|
||||
#define G3D_OSX
|
||||
#elif defined(sun) || defined(__sun__)
|
||||
#define G3D_SOLARIS
|
||||
#else
|
||||
#error Unknown platform
|
||||
#endif
|
||||
|
|
@ -102,6 +104,22 @@
|
|||
# define G3D_CHECK_VPRINTF_ARGS __attribute__((__format__(__printf__, 1, 0)))
|
||||
#endif
|
||||
|
||||
#ifdef G3D_SOLARIS
|
||||
# define G3D_DEPRECATED __attribute__((__deprecated__))
|
||||
|
||||
# ifndef __cdecl
|
||||
# define __cdecl __attribute__((cdecl))
|
||||
# endif
|
||||
|
||||
# ifndef __stdcall
|
||||
# define __stdcall __attribute__((stdcall))
|
||||
# endif
|
||||
|
||||
# define G3D_CHECK_PRINTF_METHOD_ARGS __attribute__((__format__(__printf__, 2, 3)))
|
||||
# define G3D_CHECK_VPRINTF_METHOD_ARGS __attribute__((__format__(__printf__, 2, 0)))
|
||||
# define G3D_CHECK_PRINTF_ARGS __attribute__((__format__(__printf__, 1, 2)))
|
||||
# define G3D_CHECK_VPRINTF_ARGS __attribute__((__format__(__printf__, 1, 0)))
|
||||
#endif
|
||||
|
||||
#ifdef G3D_OSX
|
||||
#ifndef __GNUC__
|
||||
|
|
|
|||
|
|
@ -257,7 +257,12 @@ private:
|
|||
}
|
||||
#endif
|
||||
|
||||
#else
|
||||
#elif defined(sun) || defined(__sun__)
|
||||
|
||||
#define MSG_NOSIGNAL 0
|
||||
typedef unsigned short port_t;
|
||||
|
||||
#else
|
||||
// ----------------------------------------
|
||||
// LINUX
|
||||
typedef unsigned long ipaddr_t;
|
||||
|
|
|
|||
|
|
@ -49,6 +49,20 @@
|
|||
|
||||
// #include <assert.h>
|
||||
|
||||
#elif defined(G3D_SOLARIS)
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/select.h>
|
||||
#include <termios.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/time.h>
|
||||
#include <pthread.h>
|
||||
|
||||
#elif defined(G3D_OSX)
|
||||
|
||||
#include <stdlib.h>
|
||||
|
|
|
|||
|
|
@ -75,6 +75,10 @@
|
|||
#include <signal.h>
|
||||
#include <assert.h>
|
||||
|
||||
#if defined(__sun__)
|
||||
#include <ieeefp.h> // finite() on Solaris
|
||||
#endif
|
||||
|
||||
#include <set>
|
||||
#include <list>
|
||||
#include <string>
|
||||
|
|
|
|||
|
|
@ -95,7 +95,11 @@ int ThreadPriority::getPriority(Priority p) const
|
|||
return m_priority[p];
|
||||
}
|
||||
|
||||
#define THREADFLAG (THR_NEW_LWP | THR_SCHED_DEFAULT| THR_JOINABLE)
|
||||
#ifndef __sun__
|
||||
# define THREADFLAG (THR_NEW_LWP | THR_JOINABLE | THR_SCHED_DEFAULT)
|
||||
#else
|
||||
# define THREADFLAG (THR_NEW_LWP | THR_JOINABLE)
|
||||
#endif
|
||||
|
||||
Thread::Thread() : m_task(0), m_iThreadId(0), m_hThreadHandle(0)
|
||||
{
|
||||
|
|
@ -220,10 +224,12 @@ Thread * Thread::current()
|
|||
|
||||
void Thread::setPriority(Priority type)
|
||||
{
|
||||
#ifndef __sun__
|
||||
int _priority = m_TpEnum.getPriority(type);
|
||||
int _ok = ACE_Thread::setprio(m_hThreadHandle, _priority);
|
||||
//remove this ASSERT in case you don't want to know is thread priority change was successful or not
|
||||
ASSERT (_ok == 0);
|
||||
#endif
|
||||
}
|
||||
|
||||
void Thread::Sleep(unsigned long msecs)
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "9448"
|
||||
#define REVISION_NR "9449"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue