windows/rexxapitypes.h
Go to the documentation of this file.
1 /*----------------------------------------------------------------------------*/
2 /* */
3 /* Copyright (c) 1995, 2004 IBM Corporation. All rights reserved. */
4 /* Copyright (c) 2005-2009 Rexx Language Association. All rights reserved. */
5 /* */
6 /* This program and the accompanying materials are made available under */
7 /* the terms of the Common Public License v1.0 which accompanies this */
8 /* distribution. A copy is also available at the following address: */
9 /* http://www.ibm.com/developerworks/oss/CPLv1.0.htm */
10 /* */
11 /* Redistribution and use in source and binary forms, with or */
12 /* without modification, are permitted provided that the following */
13 /* conditions are met: */
14 /* */
15 /* Redistributions of source code must retain the above copyright */
16 /* notice, this list of conditions and the following disclaimer. */
17 /* Redistributions in binary form must reproduce the above copyright */
18 /* notice, this list of conditions and the following disclaimer in */
19 /* the documentation and/or other materials provided with the distribution. */
20 /* */
21 /* Neither the name of Rexx Language Association nor the names */
22 /* of its contributors may be used to endorse or promote products */
23 /* derived from this software without specific prior written permission. */
24 /* */
25 /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */
26 /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */
27 /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS */
28 /* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */
29 /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
30 /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED */
31 /* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */
32 /* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY */
33 /* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */
34 /* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS */
35 /* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
36 /* */
37 /*----------------------------------------------------------------------------*/
38 #ifndef REXXAPITYPES_INCLUDED
39 #define REXXAPITYPES_INCLUDED
40 
41 #include "windows.h"
42 #include "limits.h"
43 
44 #ifdef HAVE_CONFIG_H
45 #include <config.h>
46 #endif
47 
48 typedef SSIZE_T ssize_t;
49 typedef INT_PTR intptr_t;
50 typedef UINT_PTR uintptr_t;
51 #ifdef _WIN64
52 #define __REXX64__
53 #else
54 #undef __REXX64__
55 #endif
56 
57 /* If the platform and compiler supports the C9X 'proposed' standard for
58  * integer types, and has inttypes.h, then use it by defining HAVE_INTTYPES_H.
59  *
60  * Visual C++ since 2010 has stdint.h, but by 2013 still does not have
61  * inttypes.h. In this case define HAVE_STDINT_H. Otherwise use our own
62  * defintions of the same types
63 */
64 #if defined (HAVE_INTTYPES_H)
65 #include <inttypes.h>
66 #elif defined(HAVE_STDINT_H)
67 #include <stdint.h>
68 #else
69 // portable ANSI types
70 typedef short int16_t;
71 typedef unsigned short uint16_t;
72 typedef int int32_t;
73 typedef unsigned int uint32_t;
74 typedef char int8_t;
75 typedef unsigned char uint8_t;
76 typedef signed __int64 int64_t;
77 typedef unsigned __int64 uint64_t;
78 
79 #define UINTPTR_MAX (~((uintptr_t)0))
80 #define INTPTR_MAX ((intptr_t)(UINTPTR_MAX >> 1))
81 #define INTPTR_MIN (~INTPTR_MAX)
82 
83 #define UINT32_MAX (~((uint32_t)0))
84 #define INT32_MAX ((int32_t)(UINT32_MAX >> 1))
85 #define INT32_MIN (~INT32_MAX)
86 
87 #define UINT16_MAX (uint16_t)(~((uint16_t)0))
88 #define INT16_MAX ((int16_t)(UINT16_MAX >> 1))
89 #define INT16_MIN (~INT16_MAX)
90 
91 #define UINT8_MAX (uint8_t)(~((uint8_t)0))
92 #define INT8_MAX ((int8_t)(UINT8_MAX >> 1))
93 #define INT8_MIN (~INT8_MAX)
94 
95 #define UINT64_MAX (~((uint64_t)0))
96 #define INT64_MAX ((int64_t)(UINT64_MAX >> 1))
97 #define INT64_MIN (~INT64_MAX)
98 #endif
99 
100 typedef DWORD thread_id_t;
101 typedef DWORD process_id_t;
102 
103 #define REXXENTRY APIENTRY
104 #define REXXEXPORT __declspec(dllexport)
105 
106 #ifdef __cplusplus
107 extern "C" {
108 #endif
109 typedef size_t (REXXENTRY *REXXPFN)();
110 #ifdef __cplusplus
111 }
112 #endif
113 
114 #ifndef SIZE_MAX
115 #define SIZE_MAX (~((size_t)0))
116 #endif
117 
118 #define SSIZE_MAX ((ssize_t)(SIZE_MAX >> 1))
119 #define SSIZE_MIN (~SSIZE_MAX - 1)
120 
121 #define VLARexxEntry __cdecl /* external entry points */
122 
123 #endif /* REXXAPITYPES_INCLUDED */
124 
void * REXXPFN
unsigned short uint16_t
UINT_PTR uintptr_t
int int32_t
signed __int64 int64_t
unsigned int uint32_t
DWORD process_id_t
SSIZE_T ssize_t
#define REXXENTRY
DWORD thread_id_t
short int16_t
INT_PTR intptr_t
unsigned char uint8_t
char int8_t
unsigned __int64 uint64_t