summaryrefslogtreecommitdiff
path: root/cpp/include/Ice/Config.h
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/include/Ice/Config.h')
-rw-r--r--cpp/include/Ice/Config.h61
1 files changed, 19 insertions, 42 deletions
diff --git a/cpp/include/Ice/Config.h b/cpp/include/Ice/Config.h
index a1211c23f8f..804e4ede4a7 100644
--- a/cpp/include/Ice/Config.h
+++ b/cpp/include/Ice/Config.h
@@ -27,6 +27,13 @@
#include <vector>
#include <map>
+#if defined(_WIN32)
+# include <process.h>
+#else
+# include <sys/types.h>
+# include <unistd.h>
+#endif
+
//
// Define the Ice and IceInternal namespace, so that we can use the following
// everywhere in our code:
@@ -42,21 +49,22 @@ namespace IceInternal
{
}
-#if defined(_WIN32)
-
+#ifndef ICE_API
# ifdef ICE_API_EXPORTS
-# define ICE_API __declspec(dllexport)
-# else
-# define ICE_API __declspec(dllimport)
-# endif
+# define ICE_API ICE_DECLSPEC_EXPORT
+# else
+# define ICE_API ICE_DECLSPEC_IMPORT
+# endif
+#endif
+#ifndef ICE_PROTOCOL_API
# ifdef ICE_PROTOCOL_API_EXPORTS
-# define ICE_PROTOCOL_API __declspec(dllexport)
+# define ICE_PROTOCOL_API ICE_DECLSPEC_EXPORT
# else
-# define ICE_PROTOCOL_API __declspec(dllimport)
+# define ICE_PROTOCOL_API ICE_DECLSPEC_IMPORT
# endif
+#endif
-# include <process.h>
namespace Ice
{
@@ -64,50 +72,19 @@ namespace Ice
typedef char Byte;
typedef short Short;
typedef int Int;
-typedef __int64 Long;
+typedef IceUtil::Int64 Long;
typedef float Float;
typedef double Double;
}
// TODO: Should not be inline, this is not performance critical.
+#ifdef _WIN32
inline int getSystemErrno() { return GetLastError(); }
inline int getSocketErrno() { return WSAGetLastError(); }
-
-#elif (defined(__linux__) || defined(__FreeBSD__)) && defined(i386) || defined (__sun)
-
-# include <sys/types.h>
-# include <unistd.h>
-
-# define ICE_API /**/
-# define ICE_PROTOCOL_API /**/
-
-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;
-
-}
-
-// TODO: Should not be inline, this is not performance critical.
inline int getSystemErrno() { return errno; }
inline int getSocketErrno() { return errno; }
-
-#else
-
-# error "Unsupported operating system or platform!"
-
#endif
#endif