diff --git a/dep/include/g3dlite/G3D/platform.h b/dep/include/g3dlite/G3D/platform.h index fed9c7b53..152f4f91b 100644 --- a/dep/include/g3dlite/G3D/platform.h +++ b/dep/include/g3dlite/G3D/platform.h @@ -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__ diff --git a/dep/include/sockets/socket_include.h b/dep/include/sockets/socket_include.h index 16cfe3f04..5ffaebbff 100644 --- a/dep/include/sockets/socket_include.h +++ b/dep/include/sockets/socket_include.h @@ -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; diff --git a/dep/src/g3dlite/System.cpp b/dep/src/g3dlite/System.cpp index 3f129af61..62b542521 100644 --- a/dep/src/g3dlite/System.cpp +++ b/dep/src/g3dlite/System.cpp @@ -49,6 +49,20 @@ // #include +#elif defined(G3D_SOLARIS) + + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #elif defined(G3D_OSX) #include diff --git a/src/shared/Common.h b/src/shared/Common.h index 0fa6c306d..b829ce93c 100644 --- a/src/shared/Common.h +++ b/src/shared/Common.h @@ -75,6 +75,10 @@ #include #include +#if defined(__sun__) +#include // finite() on Solaris +#endif + #include #include #include diff --git a/src/shared/Threading.cpp b/src/shared/Threading.cpp index c048b0f89..816778aad 100644 --- a/src/shared/Threading.cpp +++ b/src/shared/Threading.cpp @@ -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) diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 9a38e4ead..e4a87bcdf 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "9448" + #define REVISION_NR "9449" #endif // __REVISION_NR_H__