From 7bb8b22d8da0f6a398e2102a20d885d885339496 Mon Sep 17 00:00:00 2001 From: Guido Günther Date: Thu, 8 Jan 2009 15:39:24 +0100 Subject: import initial version from https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/dd6fc290-0201-0010-c190-86ce775d5673 --- platform.h | 113 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 113 insertions(+) create mode 100644 platform.h (limited to 'platform.h') 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 +#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 +# else +# /* shortcutting Microsoft Win32 on Intel x86i, because including */ +# /* 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_ */ -- cgit v1.2.3