[9449] Fixes for the Solaris platform.

Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
Zooey Aurora 2010-02-25 04:57:19 +03:00 committed by VladimirMangos
parent c8e45058a6
commit f40f564bd6
6 changed files with 50 additions and 3 deletions

View file

@ -45,6 +45,8 @@
#define G3D_LINUX #define G3D_LINUX
#elif defined(__APPLE__) #elif defined(__APPLE__)
#define G3D_OSX #define G3D_OSX
#elif defined(sun) || defined(__sun__)
#define G3D_SOLARIS
#else #else
#error Unknown platform #error Unknown platform
#endif #endif
@ -102,6 +104,22 @@
# define G3D_CHECK_VPRINTF_ARGS __attribute__((__format__(__printf__, 1, 0))) # define G3D_CHECK_VPRINTF_ARGS __attribute__((__format__(__printf__, 1, 0)))
#endif #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 #ifdef G3D_OSX
#ifndef __GNUC__ #ifndef __GNUC__

View file

@ -257,7 +257,12 @@ private:
} }
#endif #endif
#else #elif defined(sun) || defined(__sun__)
#define MSG_NOSIGNAL 0
typedef unsigned short port_t;
#else
// ---------------------------------------- // ----------------------------------------
// LINUX // LINUX
typedef unsigned long ipaddr_t; typedef unsigned long ipaddr_t;

View file

@ -49,6 +49,20 @@
// #include <assert.h> // #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) #elif defined(G3D_OSX)
#include <stdlib.h> #include <stdlib.h>

View file

@ -75,6 +75,10 @@
#include <signal.h> #include <signal.h>
#include <assert.h> #include <assert.h>
#if defined(__sun__)
#include <ieeefp.h> // finite() on Solaris
#endif
#include <set> #include <set>
#include <list> #include <list>
#include <string> #include <string>

View file

@ -95,7 +95,11 @@ int ThreadPriority::getPriority(Priority p) const
return m_priority[p]; 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) Thread::Thread() : m_task(0), m_iThreadId(0), m_hThreadHandle(0)
{ {
@ -220,10 +224,12 @@ Thread * Thread::current()
void Thread::setPriority(Priority type) void Thread::setPriority(Priority type)
{ {
#ifndef __sun__
int _priority = m_TpEnum.getPriority(type); int _priority = m_TpEnum.getPriority(type);
int _ok = ACE_Thread::setprio(m_hThreadHandle, _priority); 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 //remove this ASSERT in case you don't want to know is thread priority change was successful or not
ASSERT (_ok == 0); ASSERT (_ok == 0);
#endif
} }
void Thread::Sleep(unsigned long msecs) void Thread::Sleep(unsigned long msecs)

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__ #ifndef __REVISION_NR_H__
#define __REVISION_NR_H__ #define __REVISION_NR_H__
#define REVISION_NR "9448" #define REVISION_NR "9449"
#endif // __REVISION_NR_H__ #endif // __REVISION_NR_H__