summaryrefslogtreecommitdiff
path: root/cpp/include
diff options
context:
space:
mode:
authorBernard Normier <bernard@zeroc.com>2003-04-04 23:24:43 +0000
committerBernard Normier <bernard@zeroc.com>2003-04-04 23:24:43 +0000
commitb8c9b0c0d76730a18c99ec15bbdf8959562ea4fc (patch)
tree8794d504f8d5798cb4a43785e686926f9e993877 /cpp/include
parentfixes (diff)
downloadice-b8c9b0c0d76730a18c99ec15bbdf8959562ea4fc.tar.bz2
ice-b8c9b0c0d76730a18c99ec15bbdf8959562ea4fc.tar.xz
ice-b8c9b0c0d76730a18c99ec15bbdf8959562ea4fc.zip
Initial phase of Sun support
Diffstat (limited to 'cpp/include')
-rw-r--r--cpp/include/Ice/Config.h8
-rw-r--r--cpp/include/Ice/Const.h10
-rw-r--r--cpp/include/IceUtil/Config.h6
-rw-r--r--cpp/include/IceUtil/RWRecMutex.h36
-rw-r--r--cpp/include/IceUtil/Shared.h2
5 files changed, 41 insertions, 21 deletions
diff --git a/cpp/include/Ice/Config.h b/cpp/include/Ice/Config.h
index 0dd78d1d584..6f73221b81c 100644
--- a/cpp/include/Ice/Config.h
+++ b/cpp/include/Ice/Config.h
@@ -75,7 +75,7 @@ inline int getSystemErrno() { return GetLastError(); }
inline int getSocketErrno() { return WSAGetLastError(); }
inline int getDNSErrno() { return WSAGetLastError(); }
-#elif (defined(__linux__) || defined(__FreeBSD__)) && defined(i386)
+#elif (defined(__linux__) || defined(__FreeBSD__)) && defined(i386) || defined (__sun)
# include <sys/types.h>
# include <unistd.h>
@@ -89,7 +89,13 @@ namespace Ice
typedef char Byte;
typedef short Short;
typedef int Int;
+
+#ifdef __sparcv9
+typedef long Long
+#else
typedef long long Long;
+#endif
+
typedef float Float;
typedef double Double;
diff --git a/cpp/include/Ice/Const.h b/cpp/include/Ice/Const.h
index 39457c89d60..044fd3a8741 100644
--- a/cpp/include/Ice/Const.h
+++ b/cpp/include/Ice/Const.h
@@ -15,10 +15,18 @@
#ifndef ICE_CONST_H
#define ICE_CONST_H
+//
+// TODO: - switch to C++ compiler macros, since this syntax is compiler
+// dependent
+// - define an ICE_WIDTH macro (or ICE_32 and ICE_64?) to avoid doing
+// the 32 vs 64 bit checks in multiple places.
+
#if defined(_WIN32)
# define ICE_INT64_LITERAL(n) n##i64
-#elif defined(__linux__) && defined(i386)
+#elif defined(__linux__) && defined(i386) || (defined (__sun) && !defined(__sparcv9))
# define ICE_INT64_LITERAL(n) n##LL
+#elif defined (__sun) && defined(__sparcv9)
+# define ICE_INT64_LITERAL(n) n##L
#else
# error "Unsupported operating system or platform!"
#endif
diff --git a/cpp/include/IceUtil/Config.h b/cpp/include/IceUtil/Config.h
index 89089c451dc..75bda4994a7 100644
--- a/cpp/include/IceUtil/Config.h
+++ b/cpp/include/IceUtil/Config.h
@@ -76,6 +76,12 @@
# define __STDC_LIMIT_MACROS
# include <stdint.h>
+#elif defined(__sun) && defined(__sparc)
+
+# define ICE_UTIL_API /**/
+# define SIZEOF_WCHAR_T 4
+# include <inttypes.h>
+
#else
# error "unsupported operating system or platform"
diff --git a/cpp/include/IceUtil/RWRecMutex.h b/cpp/include/IceUtil/RWRecMutex.h
index 9e47bdba894..362ee2e0314 100644
--- a/cpp/include/IceUtil/RWRecMutex.h
+++ b/cpp/include/IceUtil/RWRecMutex.h
@@ -23,17 +23,17 @@ namespace IceUtil
{
template <typename T>
-class RLock
+class RLockT
{
public:
- RLock(const T& mutex) :
+ RLockT(const T& mutex) :
_mutex(mutex)
{
_mutex.readlock();
}
- ~RLock()
+ ~RLockT()
{
_mutex.unlock();
}
@@ -56,23 +56,23 @@ private:
};
template <typename T>
-class TryRLock
+class TryRLockT
{
public:
- TryRLock(const T& mutex) :
+ TryRLockT(const T& mutex) :
_mutex(mutex)
{
_mutex.tryReadlock();
}
- TryRLock(const T& mutex, const Time& timeout) :
+ TryRLockT(const T& mutex, const Time& timeout) :
_mutex(mutex)
{
_mutex.timedTryReadlock(timeout);
}
- ~TryRLock()
+ ~TryRLockT()
{
_mutex.unlock();
}
@@ -95,17 +95,17 @@ private:
};
template <typename T>
-class WLock
+class WLockT
{
public:
- WLock(const T& mutex) :
+ WLockT(const T& mutex) :
_mutex(mutex)
{
_mutex.writelock();
}
- ~WLock()
+ ~WLockT()
{
_mutex.unlock();
}
@@ -116,23 +116,23 @@ private:
};
template <typename T>
-class TryWLock
+class TryWLockT
{
public:
- TryWLock(const T& mutex) :
+ TryWLockT(const T& mutex) :
_mutex(mutex)
{
_mutex.tryWritelock();
}
- TryWLock(const T& mutex, const Time& timeout) :
+ TryWLockT(const T& mutex, const Time& timeout) :
_mutex(mutex)
{
_mutex.timedTryWritelock(timeout);
}
- ~TryWLock()
+ ~TryWLockT()
{
_mutex.unlock();
}
@@ -159,10 +159,10 @@ public:
//
// RLock (reader) & WLock (writer) typedefs.
//
- typedef RLock<RWRecMutex> RLock;
- typedef TryRLock<RWRecMutex> TryRLock;
- typedef WLock<RWRecMutex> WLock;
- typedef TryWLock<RWRecMutex> TryWLock;
+ typedef RLockT<RWRecMutex> RLock;
+ typedef TryRLockT<RWRecMutex> TryRLock;
+ typedef WLockT<RWRecMutex> WLock;
+ typedef TryWLockT<RWRecMutex> TryWLock;
RWRecMutex();
~RWRecMutex();
diff --git a/cpp/include/IceUtil/Shared.h b/cpp/include/IceUtil/Shared.h
index 7b8d2aa8128..aae20dc017a 100644
--- a/cpp/include/IceUtil/Shared.h
+++ b/cpp/include/IceUtil/Shared.h
@@ -20,7 +20,7 @@
//
// The inline assembler causes problems with shared libraries.
//
-#if defined(__ICC) && !defined(_WIN32)
+#if (defined(__ICC) && !defined(_WIN32)) || defined (__sun)
# define ICE_USE_MUTEX_SHARED
#endif