blob: 71a6d4d93261ccf4da4d8f2d7326e8de8b625f37 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
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_ */
|