aboutsummaryrefslogtreecommitdiff
path: root/platform.h
diff options
context:
space:
mode:
Diffstat (limited to 'platform.h')
-rw-r--r--platform.h113
1 files changed, 113 insertions, 0 deletions
diff --git a/platform.h b/platform.h
new file mode 100644
index 0000000..71a6d4d
--- /dev/null
+++ b/platform.h
@@ -0,0 +1,113 @@
+/************************************************************************/
+/* $Id: platform.h,v 1.1.1.1 1999/08/24 14:36:21 d019080 Exp $
+ ************************************************************************/
+/*
+ * (C) Copyright 1999 SAP AG Walldorf
+ *
+ * SAP AG DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL SAP AG BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
+ * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
+ * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
+ * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+ * OF THIS SOFTWARE.
+ */
+
+
+#ifndef _XX_PLATFORM_H_
+# define _XX_PLATFORM_H_
+
+
+#ifndef USHRT_MAX
+# include <limits.h>
+#endif
+
+
+#if USHRT_MAX >= 0x10000ul
+# define XX_SIZEOF_USHORT 4
+# error cannot handle unsigned short > 2 bytes
+#else
+# define XX_SIZEOF_USHORT 2
+#endif
+
+#if UINT_MAX >= 0x10000ul
+# define XX_SIZEOF_UINT 4
+#else
+# define XX_SIZEOF_UINT 2
+#endif
+
+#if ULONG_MAX > 0xFFFFFFFFul
+# define XX_SIZEOF_ULONG 8
+#else
+# define XX_SIZEOF_ULONG 4
+#endif
+
+
+#if (XX_SIZEOF_UINT == 4)
+
+ typedef unsigned int Uint32;
+
+#elif (XX_SIZEOF_ULONG == 4)
+
+ typedef unsigned long Uint32;
+
+#elif (XX_SIZEOF_USHORT == 4)
+
+ typedef unsigned short Uint32;
+
+#endif
+
+
+
+/*
+ * Define DLL_FUNC_DECO, DLL_DATA_DECO, FUNCPTR_DECO and FAR
+ */
+
+#if defined(_WIN32)
+# if !defined(WINAPI)
+# if !defined(_M_IX86)
+# include <windows.h>
+# else
+# /* shortcutting Microsoft Win32 on Intel x86i, because including */
+# /* <windows.h> is painfully timeconsuming during development ... */
+# define WINAPI __stdcall
+# endif
+# endif
+# define FUNCPTR_DECO WINAPI
+# define EXPORT_FUNCTION __declspec(dllexport) WINAPI
+# define EXPORT_DATA __declspec(dllexport)
+# define IMPORT_FUNCTION __declspec(dllimport) WINAPI
+# define IMPORT_DATA __declspec(dllimport)
+#elif defined(_WINDOWS)
+# if !defined(WINAPI)
+# define WINAPI __far __pascal
+# endif
+# define FUNCPTR_DECO WINAPI
+# define EXPORT_FUNCTION __export WINAPI
+# define EXPORT_DATA __export
+# define IMPORT_FUNCTION __export WINAPI
+# define IMPORT_DATA __export
+# define FAR __far
+#else
+# define EXPORT_FUNCTION
+# define EXPORT_DATA
+# define IMPORT_FUNCTION
+# define IMPORT_DATA
+# define FUNCPTR_DECO
+#endif
+
+#ifdef BUILDING_DLL
+# define DLL_DATA_DECO EXPORT_DATA
+# define DLL_FUNC_DECO EXPORT_FUNCTION
+#else
+# define DLL_DATA_DECO IMPORT_DATA
+# define DLL_FUNC_DECO IMPORT_FUNCTION
+#endif
+
+#ifndef FAR
+# define FAR
+#endif
+
+
+
+#endif /* _XX_PLATFORM_H_ */