aboutsummaryrefslogtreecommitdiff
path: root/llimits.h
diff options
context:
space:
mode:
Diffstat (limited to 'llimits.h')
-rw-r--r--llimits.h92
1 files changed, 2 insertions, 90 deletions
diff --git a/llimits.h b/llimits.h
index 7c634f67..50a44651 100644
--- a/llimits.h
+++ b/llimits.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: llimits.h,v 1.56 2003/07/29 19:26:34 roberto Exp roberto $ 2** $Id: llimits.h,v 1.57 2003/12/01 16:33:30 roberto Exp roberto $
3** Limits, basic types, and some other `installation-dependent' definitions 3** Limits, basic types, and some other `installation-dependent' definitions
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -15,48 +15,9 @@
15#include "lua.h" 15#include "lua.h"
16 16
17 17
18/*
19** try to find number of bits in an integer
20*/
21#ifndef BITS_INT
22/* avoid overflows in comparison */
23#if INT_MAX-20 < 32760
24#define BITS_INT 16
25#elif INT_MAX > 2147483640L
26/* machine has at least 32 bits */
27#define BITS_INT 32
28#else
29#error "you must define BITS_INT with number of bits in an integer"
30#endif
31#endif
32
33
34/*
35** the following types define integer types for values that may not
36** fit in a `small int' (16 bits), but may waste space in a
37** `large long' (64 bits). The current definitions should work in
38** any machine, but may not be optimal.
39*/
40
41
42/*
43** an unsigned integer with at least 32 bits
44*/
45#ifndef LUA_UINT32
46#define LUA_UINT32 unsigned long
47#endif
48 18
49typedef LUA_UINT32 lu_int32; 19typedef LUA_UINT32 lu_int32;
50 20
51
52/*
53** a signed integer with at least 32 bits
54*/
55#ifndef LUA_INT32
56#define LUA_INT32 long
57#define LUA_MAXINT32 LONG_MAX
58#endif
59
60typedef LUA_INT32 l_int32; 21typedef LUA_INT32 l_int32;
61 22
62 23
@@ -95,19 +56,11 @@ typedef unsigned char lu_byte;
95 56
96 57
97/* type to ensure maximum alignment */ 58/* type to ensure maximum alignment */
98#ifndef LUSER_ALIGNMENT_T
99typedef union { double u; void *s; long l; } L_Umaxalign;
100#else
101typedef LUSER_ALIGNMENT_T L_Umaxalign; 59typedef LUSER_ALIGNMENT_T L_Umaxalign;
102#endif
103 60
104 61
105/* result of `usual argument conversion' over lua_Number */ 62/* result of a `usual argument conversion' over lua_Number */
106#ifndef LUA_UACNUMBER
107typedef double l_uacNumber;
108#else
109typedef LUA_UACNUMBER l_uacNumber; 63typedef LUA_UACNUMBER l_uacNumber;
110#endif
111 64
112 65
113#ifndef lua_assert 66#ifndef lua_assert
@@ -138,43 +91,11 @@ typedef LUA_UACNUMBER l_uacNumber;
138typedef lu_int32 Instruction; 91typedef lu_int32 Instruction;
139 92
140 93
141/* maximum depth for calls (unsigned short) */
142#ifndef LUA_MAXCALLS
143#define LUA_MAXCALLS 4096
144#endif
145
146
147/*
148** maximum depth for C calls (unsigned short): Not too big, or may
149** overflow the C stack...
150*/
151
152#ifndef LUA_MAXCCALLS
153#define LUA_MAXCCALLS 200
154#endif
155
156
157/* maximum size for the virtual stack of a C function */
158#ifndef LUA_MAXCSTACK
159#define LUA_MAXCSTACK 2048
160#endif
161
162 94
163/* maximum stack for a Lua function */ 95/* maximum stack for a Lua function */
164#define MAXSTACK 250 96#define MAXSTACK 250
165 97
166 98
167/* maximum number of variables declared in a function */
168#ifndef MAXVARS
169#define MAXVARS 200 /* <MAXSTACK */
170#endif
171
172
173/* maximum number of upvalues per function */
174#ifndef MAXUPVALUES
175#define MAXUPVALUES 32 /* <MAXSTACK */
176#endif
177
178 99
179/* minimum size for the string table (must be power of 2) */ 100/* minimum size for the string table (must be power of 2) */
180#ifndef MINSTRTABSIZE 101#ifndef MINSTRTABSIZE
@@ -188,13 +109,4 @@ typedef lu_int32 Instruction;
188#endif 109#endif
189 110
190 111
191/*
192** maximum number of syntactical nested non-terminals: Not too big,
193** or may overflow the C stack...
194*/
195#ifndef LUA_MAXPARSERLEVEL
196#define LUA_MAXPARSERLEVEL 200
197#endif
198
199
200#endif 112#endif