windows/PlatformDefinitions.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.oorexx.org/license.html */
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 /******************************************************************************/
39 /* REXX WIN32 Support winrexx.h */
40 /* */
41 /* WIN32 master definition file */
42 /* */
43 /******************************************************************************/
44 
45 /******************************************************************************/
46 /* Template for system specific declarations for Object REXX. The following */
47 /* sections are a series of required and optional sections where system */
48 /* specific information is provided to the rest of the interpreter code. */
49 /* Wherever possible, reasonable defaults are provided for these settings. */
50 /******************************************************************************/
51 
52 #ifndef WINREXX_H /* provide a define here to protect */
53 #define WINREXX_H /* against multiple includes */
54 
55 /******************************************************************************/
56 /* REQUIRED: The implemenation must decide on the C_STACK_SIZE defining */
57 /* constants that are compiler/linker dependent. */
58 /******************************************************************************/
59 // we need a little more space on 64-bit platforms, so add some padding based on
60 // the size of a pointer
61 #define MIN_C_STACK 1024*(32 + sizeof(void *))
62 #define TOTAL_STACK_SIZE 1024*512
63 #define C_STACK_SIZE 60000
64 
65 #define SysCall _cdecl
66 
67 /******************************************************************************/
68 /* OPTIONAL: Perform stack bounds checking on new message invocations. If */
69 /* this is a non-stack based calling convention, or it is not possible to */
70 /* determine the bounds of the stack, leave this undefined. */
71 /******************************************************************************/
72 #define STACKCHECK
73 
74 /******************************************************************************/
75 /* OPTIONAL: No time slicing support for REXX activation yields is available.*/
76 /* Code will yield after a given count of instructions. */
77 /******************************************************************************/
78 //
79 // timers in windows only get called back at yield boundaries
80 //
81 //#define NOTIMER // used in activa, activi for
82  // count based yielding
83 
84 /******************************************************************************/
85 /* OPTIONAL: Enable concurrency timeslice dispatching support. Default is */
86 /* only yield at specific event points. */
87 /******************************************************************************/
88 // Make this clearer? Mutually exclusive with NOTIMER?
89 #define TIMESLICE
90 #define FIXEDTIMERS
91 
92 /******************************************************************************/
93 /* OPTIONAL: If the implementation enables external scripting support, then */
94 /* additional hand-shaking with an the exernal environment is enabled for */
95 /* providing default values for uninitialized variables. */
96 /******************************************************************************/
97 #define SCRIPTING
98 
99 /******************************************************************************/
100 /* REQUIRED: Define the string used for the default initial address setting. */
101 /******************************************************************************/
102 
103 #define SYSINITIALADDRESS "CMD"
104 
105 /******************************************************************************/
106 /* REQUIRED: Define the name of the image file that is saved and restored. */
107 /******************************************************************************/
108 
109 #define BASEIMAGE "rexx.img"
110 
111 /******************************************************************************/
112 /* REQUIRED: Define the name of the program called to load create the saved */
113 /* image file. */
114 /******************************************************************************/
115 
116 #define BASEIMAGELOAD "CoreClasses.orx"
117 
118 /******************************************************************************/
119 /* REQUIRED: Name of the file used to store the external message repository */
120 /******************************************************************************/
121 #define REXXMESSAGEFILE "winatab.rc"
122 
123 /******************************************************************************/
124 /* REQUIRED: define the path delimiter and end of line information */
125 /* appropriate for this file system. */
126 /******************************************************************************/
127 
128 #define delimiter '\\'
129 #define line_end "\r\n"
130 #define line_end_size 2
131 
132 /******************************************************************************/
133 /* OPTIONAL: Overrides for any functions defined in sysdef.h. These */
134 /* can map the calls directly to inline code or comment them out all together.*/
135 /******************************************************************************/
136 
137 #define DEFRXSTRING 256 /* Default RXSTRING return size */
138 
139 /******************************************************************************/
140 /* OPTIONAL: Finally, any other global defined constants for system specific */
141 /* code usage. */
142 /******************************************************************************/
143  // Re-directed output...
144  #include <stdio.h> // for following file ref...
145  // another annoying incompatibility in MS compiler.
146  #if _MSC_VER < 1800
147 #define isnan(x) _isnan(x)
148 #endif
149 
150  // Exception handling
151  typedef BOOL __stdcall CONSOLECTRLHANDLER(DWORD);
153 
154  #define WinBeginExceptions SetConsoleCtrlHandler(&WinConsoleCtrlHandler, true);\
155  __try {
156  #define WinEndExceptions } __except ( WinExceptionFilter(GetExceptionCode( ))) { }\
157  SetConsoleCtrlHandler(&WinConsoleCtrlHandler, FALSE);
158 
159  int WinExceptionFilter( int xCode );
160 #endif
161 
CONSOLECTRLHANDLER WinConsoleCtrlHandler
BOOL __stdcall CONSOLECTRLHANDLER(DWORD)
int WinExceptionFilter(int xCode)