1323530Savg/*
2323530Savg** $Id: luaconf.h,v 1.176.1.2 2013/11/21 17:26:16 roberto Exp $
3323530Savg** Configuration file for Lua
4323530Savg** See Copyright Notice in lua.h
5323530Savg*/
6323530Savg
7323530Savg
8323530Savg#ifndef lconfig_h
9323530Savg#define lconfig_h
10323530Savg
11323530Savg#include <sys/zfs_context.h>
12324163Savg#ifdef illumos
13323530Savg#include <sys/int_fmtio.h>
14324163Savg#else
15324163Savg#include <machine/_inttypes.h>
16324163Savg#endif
17323530Savg
18323530Savgextern ssize_t lcompat_sprintf(char *, const char *, ...);
19323530Savgextern int64_t lcompat_strtoll(const char *, char **);
20323530Savgextern int64_t lcompat_pow(int64_t, int64_t);
21323530Savg
22323530Savg/*
23323530Savg** ==================================================================
24323530Savg** Search for "@@" to find all configurable definitions.
25323530Savg** ===================================================================
26323530Savg*/
27323530Savg
28323530Savg
29323530Savg/*
30323530Savg@@ LUA_ANSI controls the use of non-ansi features.
31323530Savg** CHANGE it (define it) if you want Lua to avoid the use of any
32323530Savg** non-ansi feature or library.
33323530Savg*/
34323530Savg#if !defined(LUA_ANSI) && defined(__STRICT_ANSI__)
35323530Savg#define LUA_ANSI
36323530Savg#endif
37323530Savg
38323530Savg
39323530Savg#if !defined(LUA_ANSI) && defined(_WIN32) && !defined(_WIN32_WCE)
40323530Savg#define LUA_WIN		/* enable goodies for regular Windows platforms */
41323530Savg#endif
42323530Savg
43323530Savg#if defined(LUA_WIN)
44323530Savg#define LUA_DL_DLL
45323530Savg#define LUA_USE_AFORMAT		/* assume 'printf' handles 'aA' specifiers */
46323530Savg#endif
47323530Savg
48323530Savg
49323530Savg
50323530Savg#if defined(LUA_USE_LINUX)
51323530Savg#define LUA_USE_POSIX
52323530Savg#define LUA_USE_DLOPEN		/* needs an extra library: -ldl */
53323530Savg#define LUA_USE_READLINE	/* needs some extra libraries */
54323530Savg#define LUA_USE_STRTODHEX	/* assume 'strtod' handles hex formats */
55323530Savg#define LUA_USE_AFORMAT		/* assume 'printf' handles 'aA' specifiers */
56323530Savg#define LUA_USE_LONGLONG	/* assume support for long long */
57323530Savg#endif
58323530Savg
59323530Savg#if defined(LUA_USE_MACOSX)
60323530Savg#define LUA_USE_POSIX
61323530Savg#define LUA_USE_DLOPEN		/* does not need -ldl */
62323530Savg#define LUA_USE_READLINE	/* needs an extra library: -lreadline */
63323530Savg#define LUA_USE_STRTODHEX	/* assume 'strtod' handles hex formats */
64323530Savg#define LUA_USE_AFORMAT		/* assume 'printf' handles 'aA' specifiers */
65323530Savg#define LUA_USE_LONGLONG	/* assume support for long long */
66323530Savg#endif
67323530Savg
68323530Savg
69323530Savg
70323530Savg/*
71323530Savg@@ LUA_USE_POSIX includes all functionality listed as X/Open System
72323530Savg@* Interfaces Extension (XSI).
73323530Savg** CHANGE it (define it) if your system is XSI compatible.
74323530Savg*/
75323530Savg#if defined(LUA_USE_POSIX)
76323530Savg#define LUA_USE_MKSTEMP
77323530Savg#define LUA_USE_ISATTY
78323530Savg#define LUA_USE_POPEN
79323530Savg#define LUA_USE_ULONGJMP
80323530Savg#define LUA_USE_GMTIME_R
81323530Savg#endif
82323530Savg
83323530Savg
84323530Savg
85323530Savg/*
86323530Savg@@ LUA_PATH_DEFAULT is the default path that Lua uses to look for
87323530Savg@* Lua libraries.
88323530Savg@@ LUA_CPATH_DEFAULT is the default path that Lua uses to look for
89323530Savg@* C libraries.
90323530Savg** CHANGE them if your machine has a non-conventional directory
91323530Savg** hierarchy or if you want to install your libraries in
92323530Savg** non-conventional directories.
93323530Savg*/
94323530Savg#if defined(_WIN32)	/* { */
95323530Savg/*
96323530Savg** In Windows, any exclamation mark ('!') in the path is replaced by the
97323530Savg** path of the directory of the executable file of the current process.
98323530Savg*/
99323530Savg#define LUA_LDIR	"!\\lua\\"
100323530Savg#define LUA_CDIR	"!\\"
101323530Savg#define LUA_PATH_DEFAULT  \
102323530Savg		LUA_LDIR"?.lua;"  LUA_LDIR"?\\init.lua;" \
103323530Savg		LUA_CDIR"?.lua;"  LUA_CDIR"?\\init.lua;" ".\\?.lua"
104323530Savg#define LUA_CPATH_DEFAULT \
105323530Savg		LUA_CDIR"?.dll;" LUA_CDIR"loadall.dll;" ".\\?.dll"
106323530Savg
107323530Savg#else			/* }{ */
108323530Savg
109323530Savg#define LUA_VDIR	LUA_VERSION_MAJOR "." LUA_VERSION_MINOR "/"
110323530Savg#define LUA_ROOT	"/usr/local/"
111323530Savg#define LUA_LDIR	LUA_ROOT "share/lua/" LUA_VDIR
112323530Savg#define LUA_CDIR	LUA_ROOT "lib/lua/" LUA_VDIR
113323530Savg#define LUA_PATH_DEFAULT  \
114323530Savg		LUA_LDIR"?.lua;"  LUA_LDIR"?/init.lua;" \
115323530Savg		LUA_CDIR"?.lua;"  LUA_CDIR"?/init.lua;" "./?.lua"
116323530Savg#define LUA_CPATH_DEFAULT \
117323530Savg		LUA_CDIR"?.so;" LUA_CDIR"loadall.so;" "./?.so"
118323530Savg#endif			/* } */
119323530Savg
120323530Savg
121323530Savg/*
122323530Savg@@ LUA_DIRSEP is the directory separator (for submodules).
123323530Savg** CHANGE it if your machine does not use "/" as the directory separator
124323530Savg** and is not Windows. (On Windows Lua automatically uses "\".)
125323530Savg*/
126323530Savg#if defined(_WIN32)
127323530Savg#define LUA_DIRSEP	"\\"
128323530Savg#else
129323530Savg#define LUA_DIRSEP	"/"
130323530Savg#endif
131323530Savg
132323530Savg
133323530Savg/*
134323530Savg@@ LUA_ENV is the name of the variable that holds the current
135323530Savg@@ environment, used to access global names.
136323530Savg** CHANGE it if you do not like this name.
137323530Savg*/
138323530Savg#define LUA_ENV		"_ENV"
139323530Savg
140323530Savg
141323530Savg/*
142323530Savg@@ LUA_API is a mark for all core API functions.
143323530Savg@@ LUALIB_API is a mark for all auxiliary library functions.
144323530Savg@@ LUAMOD_API is a mark for all standard library opening functions.
145323530Savg** CHANGE them if you need to define those functions in some special way.
146323530Savg** For instance, if you want to create one Windows DLL with the core and
147323530Savg** the libraries, you may want to use the following definition (define
148323530Savg** LUA_BUILD_AS_DLL to get it).
149323530Savg*/
150323530Savg#if defined(LUA_BUILD_AS_DLL)	/* { */
151323530Savg
152323530Savg#if defined(LUA_CORE) || defined(LUA_LIB)	/* { */
153323530Savg#define LUA_API __declspec(dllexport)
154323530Savg#else						/* }{ */
155323530Savg#define LUA_API __declspec(dllimport)
156323530Savg#endif						/* } */
157323530Savg
158323530Savg#else				/* }{ */
159323530Savg
160323530Savg#define LUA_API		extern
161323530Savg
162323530Savg#endif				/* } */
163323530Savg
164323530Savg
165323530Savg/* more often than not the libs go together with the core */
166323530Savg#define LUALIB_API	LUA_API
167323530Savg#define LUAMOD_API	LUALIB_API
168323530Savg
169323530Savg
170323530Savg/*
171323530Savg@@ LUAI_FUNC is a mark for all extern functions that are not to be
172323530Savg@* exported to outside modules.
173323530Savg@@ LUAI_DDEF and LUAI_DDEC are marks for all extern (const) variables
174323530Savg@* that are not to be exported to outside modules (LUAI_DDEF for
175323530Savg@* definitions and LUAI_DDEC for declarations).
176323530Savg** CHANGE them if you need to mark them in some special way. Elf/gcc
177323530Savg** (versions 3.2 and later) mark them as "hidden" to optimize access
178323530Savg** when Lua is compiled as a shared library. Not all elf targets support
179323530Savg** this attribute. Unfortunately, gcc does not offer a way to check
180323530Savg** whether the target offers that support, and those without support
181323530Savg** give a warning about it. To avoid these warnings, change to the
182323530Savg** default definition.
183323530Savg*/
184323530Savg#if defined(__GNUC__) && ((__GNUC__*100 + __GNUC_MINOR__) >= 302) && \
185323530Savg    defined(__ELF__)		/* { */
186323530Savg#define LUAI_FUNC	__attribute__((visibility("hidden"))) extern
187323530Savg#define LUAI_DDEC	LUAI_FUNC
188323530Savg#define LUAI_DDEF	/* empty */
189323530Savg
190323530Savg#else				/* }{ */
191323530Savg#define LUAI_FUNC	extern
192323530Savg#define LUAI_DDEC	extern
193323530Savg#define LUAI_DDEF	/* empty */
194323530Savg#endif				/* } */
195323530Savg
196323530Savg
197323530Savg
198323530Savg/*
199323530Savg@@ LUA_QL describes how error messages quote program elements.
200323530Savg** CHANGE it if you want a different appearance.
201323530Savg*/
202323530Savg#define LUA_QL(x)	"'" x "'"
203323530Savg#define LUA_QS		LUA_QL("%s")
204323530Savg
205323530Savg
206323530Savg/*
207323530Savg@@ LUA_IDSIZE gives the maximum size for the description of the source
208323530Savg@* of a function in debug information.
209323530Savg** CHANGE it if you want a different size.
210323530Savg*/
211323530Savg#define LUA_IDSIZE	60
212323530Savg
213323530Savg
214323530Savg/*
215323530Savg@@ luai_writestringerror defines how to print error messages.
216323530Savg** (A format string with one argument is enough for Lua...)
217323530Savg*/
218323530Savg#ifdef _KERNEL
219323530Savg#define luai_writestringerror(s,p) \
220323530Savg	(zfs_dbgmsg((s), (p)))
221323530Savg#else
222323530Savg#define luai_writestringerror(s,p) \
223323530Savg	(fprintf(stderr, (s), (p)), fflush(stderr))
224323530Savg#endif
225323530Savg
226323530Savg
227323530Savg/*
228323530Savg@@ LUAI_MAXSHORTLEN is the maximum length for short strings, that is,
229323530Savg** strings that are internalized. (Cannot be smaller than reserved words
230323530Savg** or tags for metamethods, as these strings must be internalized;
231323530Savg** #("function") = 8, #("__newindex") = 10.)
232323530Savg*/
233323530Savg#define LUAI_MAXSHORTLEN        40
234323530Savg
235323530Savg
236323530Savg
237323530Savg/*
238323530Savg** {==================================================================
239323530Savg** Compatibility with previous versions
240323530Savg** ===================================================================
241323530Savg*/
242323530Savg
243323530Savg/*
244323530Savg@@ LUA_COMPAT_ALL controls all compatibility options.
245323530Savg** You can define it to get all options, or change specific options
246323530Savg** to fit your specific needs.
247323530Savg*/
248323530Savg#if defined(LUA_COMPAT_ALL)	/* { */
249323530Savg
250323530Savg/*
251323530Savg@@ LUA_COMPAT_UNPACK controls the presence of global 'unpack'.
252323530Savg** You can replace it with 'table.unpack'.
253323530Savg*/
254323530Savg#define LUA_COMPAT_UNPACK
255323530Savg
256323530Savg/*
257323530Savg@@ LUA_COMPAT_LOADERS controls the presence of table 'package.loaders'.
258323530Savg** You can replace it with 'package.searchers'.
259323530Savg*/
260323530Savg#define LUA_COMPAT_LOADERS
261323530Savg
262323530Savg/*
263323530Savg@@ macro 'lua_cpcall' emulates deprecated function lua_cpcall.
264323530Savg** You can call your C function directly (with light C functions).
265323530Savg*/
266323530Savg#define lua_cpcall(L,f,u)  \
267323530Savg	(lua_pushcfunction(L, (f)), \
268323530Savg	 lua_pushlightuserdata(L,(u)), \
269323530Savg	 lua_pcall(L,1,0,0))
270323530Savg
271323530Savg
272323530Savg/*
273323530Savg@@ LUA_COMPAT_LOG10 defines the function 'log10' in the math library.
274323530Savg** You can rewrite 'log10(x)' as 'log(x, 10)'.
275323530Savg*/
276323530Savg#define LUA_COMPAT_LOG10
277323530Savg
278323530Savg/*
279323530Savg@@ LUA_COMPAT_LOADSTRING defines the function 'loadstring' in the base
280323530Savg** library. You can rewrite 'loadstring(s)' as 'load(s)'.
281323530Savg*/
282323530Savg#define LUA_COMPAT_LOADSTRING
283323530Savg
284323530Savg/*
285323530Savg@@ LUA_COMPAT_MAXN defines the function 'maxn' in the table library.
286323530Savg*/
287323530Savg#define LUA_COMPAT_MAXN
288323530Savg
289323530Savg/*
290323530Savg@@ The following macros supply trivial compatibility for some
291323530Savg** changes in the API. The macros themselves document how to
292323530Savg** change your code to avoid using them.
293323530Savg*/
294323530Savg#define lua_strlen(L,i)		lua_rawlen(L, (i))
295323530Savg
296323530Savg#define lua_objlen(L,i)		lua_rawlen(L, (i))
297323530Savg
298323530Savg#define lua_equal(L,idx1,idx2)		lua_compare(L,(idx1),(idx2),LUA_OPEQ)
299323530Savg#define lua_lessthan(L,idx1,idx2)	lua_compare(L,(idx1),(idx2),LUA_OPLT)
300323530Savg
301323530Savg/*
302323530Savg@@ LUA_COMPAT_MODULE controls compatibility with previous
303323530Savg** module functions 'module' (Lua) and 'luaL_register' (C).
304323530Savg*/
305323530Savg#define LUA_COMPAT_MODULE
306323530Savg
307323530Savg#endif				/* } */
308323530Savg
309323530Savg/* }================================================================== */
310323530Savg
311323530Savg
312323530Savg
313323530Savg/*
314323530Savg@@ LUAI_BITSINT defines the number of bits in an int.
315323530Savg** CHANGE here if Lua cannot automatically detect the number of bits of
316323530Savg** your machine. Probably you do not need to change this.
317323530Savg*/
318323530Savg/* avoid overflows in comparison */
319323530Savg#if INT_MAX-20 < 32760		/* { */
320323530Savg#define LUAI_BITSINT	16
321323530Savg#elif INT_MAX > 2147483640L	/* }{ */
322323530Savg/* int has at least 32 bits */
323323530Savg#define LUAI_BITSINT	32
324323530Savg#else				/* }{ */
325323530Savg#error "you must define LUA_BITSINT with number of bits in an integer"
326323530Savg#endif				/* } */
327323530Savg
328323530Savg
329323530Savg/*
330323530Savg@@ LUA_INT32 is a signed integer with exactly 32 bits.
331323530Savg@@ LUAI_UMEM is an unsigned integer big enough to count the total
332323530Savg@* memory used by Lua.
333323530Savg@@ LUAI_MEM is a signed integer big enough to count the total memory
334323530Savg@* used by Lua.
335323530Savg** CHANGE here if for some weird reason the default definitions are not
336323530Savg** good enough for your machine. Probably you do not need to change
337323530Savg** this.
338323530Savg*/
339323530Savg#if LUAI_BITSINT >= 32		/* { */
340323530Savg#define LUA_INT32	int
341323530Savg#define LUAI_UMEM	size_t
342323530Savg#define LUAI_MEM	ptrdiff_t
343323530Savg#else				/* }{ */
344323530Savg/* 16-bit ints */
345323530Savg#define LUA_INT32	long
346323530Savg#define LUAI_UMEM	unsigned long
347323530Savg#define LUAI_MEM	long
348323530Savg#endif				/* } */
349323530Savg
350323530Savg
351323530Savg/*
352323530Savg@@ LUAI_MAXSTACK limits the size of the Lua stack.
353323530Savg** CHANGE it if you need a different limit. This limit is arbitrary;
354323530Savg** its only purpose is to stop Lua from consuming unlimited stack
355323530Savg** space (and to reserve some numbers for pseudo-indices).
356323530Savg*/
357323530Savg#if LUAI_BITSINT >= 32
358323530Savg#define LUAI_MAXSTACK		1000000
359323530Savg#else
360323530Savg#define LUAI_MAXSTACK		15000
361323530Savg#endif
362323530Savg
363323530Savg/* reserve some space for error handling */
364323530Savg#define LUAI_FIRSTPSEUDOIDX	(-LUAI_MAXSTACK - 1000)
365323530Savg
366323530Savg
367323530Savg
368323530Savg
369323530Savg/*
370323530Savg@@ LUAL_BUFFERSIZE is the buffer size used by the lauxlib buffer system.
371323530Savg** CHANGE it if it uses too much C-stack space.
372323530Savg*/
373323530Savg#define LUAL_BUFFERSIZE		1024
374323530Savg
375323530Savg
376323530Savg
377323530Savg
378323530Savg/*
379323530Savg** {==================================================================
380323530Savg@@ LUA_NUMBER is the type of numbers in Lua.
381323530Savg** CHANGE the following definitions only if you want to build Lua
382323530Savg** with a number type different from double. You may also need to
383323530Savg** change lua_number2int & lua_number2integer.
384323530Savg** ===================================================================
385323530Savg*/
386323530Savg
387323530Savg#define LUA_NUMBER	int64_t
388323530Savg
389323530Savg/*
390323530Savg@@ LUAI_UACNUMBER is the result of an 'usual argument conversion'
391323530Savg@* over a number.
392323530Savg*/
393323530Savg#define LUAI_UACNUMBER	int64_t
394323530Savg
395323530Savg
396323530Savg/*
397323530Savg@@ LUA_NUMBER_SCAN is the format for reading numbers.
398323530Savg@@ LUA_NUMBER_FMT is the format for writing numbers.
399323530Savg@@ lua_number2str converts a number to a string.
400323530Savg@@ LUAI_MAXNUMBER2STR is maximum size of previous conversion.
401323530Savg*/
402323530Savg#define LUA_NUMBER_FMT		"%" PRId64
403323530Savg#define lua_number2str(s,n)	lcompat_sprintf((s), LUA_NUMBER_FMT, (n))
404323530Savg#define LUAI_MAXNUMBER2STR	32 /* 16 digits, sign, point, and \0 */
405323530Savg
406323530Savg
407323530Savg/*
408323530Savg@@ l_mathop allows the addition of an 'l' or 'f' to all math operations
409323530Savg*/
410323530Savg#define l_mathop(x)		(x ## l)
411323530Savg
412323530Savg
413323530Savg/*
414323530Savg@@ lua_str2number converts a decimal numeric string to a number.
415323530Savg@@ lua_strx2number converts an hexadecimal numeric string to a number.
416323530Savg** In C99, 'strtod' does both conversions. C89, however, has no function
417323530Savg** to convert floating hexadecimal strings to numbers. For these
418323530Savg** systems, you can leave 'lua_strx2number' undefined and Lua will
419323530Savg** provide its own implementation.
420323530Savg*/
421323530Savg#define lua_str2number(s,p)	lcompat_strtoll((s), (p))
422323530Savg
423323530Savg#if defined(LUA_USE_STRTODHEX)
424323530Savg#define lua_strx2number(s,p)	lcompat_strtoll((s), (p))
425323530Savg#endif
426323530Savg
427323530Savg
428323530Savg/*
429323530Savg@@ The luai_num* macros define the primitive operations over numbers.
430323530Savg*/
431323530Savg
432323530Savg/* the following operations need the math library */
433323530Savg#if defined(lobject_c) || defined(lvm_c)
434323530Savg#define luai_nummod(L,a,b)	((a) % (b))
435323530Savg#define luai_numpow(L,a,b)	(lcompat_pow((a),(b)))
436323530Savg#endif
437323530Savg
438323530Savg/* these are quite standard operations */
439323530Savg#if defined(LUA_CORE)
440323530Savg#define luai_numadd(L,a,b)	((a)+(b))
441323530Savg#define luai_numsub(L,a,b)	((a)-(b))
442323530Savg#define luai_nummul(L,a,b)	((a)*(b))
443323530Savg#define luai_numdiv(L,a,b)	((a)/(b))
444323530Savg#define luai_numunm(L,a)	(-(a))
445323530Savg#define luai_numeq(a,b)		((a)==(b))
446323530Savg#define luai_numlt(L,a,b)	((a)<(b))
447323530Savg#define luai_numle(L,a,b)	((a)<=(b))
448323530Savg#define luai_numisnan(L,a)	(!luai_numeq((a), (a)))
449323530Savg#endif
450323530Savg
451323530Savg
452323530Savg
453323530Savg/*
454323530Savg@@ LUA_INTEGER is the integral type used by lua_pushinteger/lua_tointeger.
455323530Savg** CHANGE that if ptrdiff_t is not adequate on your machine. (On most
456323530Savg** machines, ptrdiff_t gives a good choice between int or long.)
457323530Savg*/
458323530Savg#define LUA_INTEGER	ptrdiff_t
459323530Savg
460323530Savg/*
461323530Savg@@ LUA_UNSIGNED is the integral type used by lua_pushunsigned/lua_tounsigned.
462323530Savg** It must have at least 32 bits.
463323530Savg*/
464323530Savg#define LUA_UNSIGNED	uint64_t
465323530Savg
466323530Savg
467323530Savg
468323530Savg/*
469323530Savg** Some tricks with doubles
470323530Savg*/
471323530Savg
472323530Savg#if defined(LUA_NUMBER_DOUBLE) && !defined(LUA_ANSI)	/* { */
473323530Savg/*
474323530Savg** The next definitions activate some tricks to speed up the
475323530Savg** conversion from doubles to integer types, mainly to LUA_UNSIGNED.
476323530Savg**
477323530Savg@@ LUA_MSASMTRICK uses Microsoft assembler to avoid clashes with a
478323530Savg** DirectX idiosyncrasy.
479323530Savg**
480323530Savg@@ LUA_IEEE754TRICK uses a trick that should work on any machine
481323530Savg** using IEEE754 with a 32-bit integer type.
482323530Savg**
483323530Savg@@ LUA_IEEELL extends the trick to LUA_INTEGER; should only be
484323530Savg** defined when LUA_INTEGER is a 32-bit integer.
485323530Savg**
486323530Savg@@ LUA_IEEEENDIAN is the endianness of doubles in your machine
487323530Savg** (0 for little endian, 1 for big endian); if not defined, Lua will
488323530Savg** check it dynamically for LUA_IEEE754TRICK (but not for LUA_NANTRICK).
489323530Savg**
490323530Savg@@ LUA_NANTRICK controls the use of a trick to pack all types into
491323530Savg** a single double value, using NaN values to represent non-number
492323530Savg** values. The trick only works on 32-bit machines (ints and pointers
493323530Savg** are 32-bit values) with numbers represented as IEEE 754-2008 doubles
494323530Savg** with conventional endianess (12345678 or 87654321), in CPUs that do
495323530Savg** not produce signaling NaN values (all NaNs are quiet).
496323530Savg*/
497323530Savg
498323530Savg/* Microsoft compiler on a Pentium (32 bit) ? */
499323530Savg#if defined(LUA_WIN) && defined(_MSC_VER) && defined(_M_IX86)	/* { */
500323530Savg
501323530Savg#define LUA_MSASMTRICK
502323530Savg#define LUA_IEEEENDIAN		0
503323530Savg#define LUA_NANTRICK
504323530Savg
505323530Savg
506323530Savg/* pentium 32 bits? */
507323530Savg#elif defined(__i386__) || defined(__i386) || defined(__X86__) /* }{ */
508323530Savg
509323530Savg#define LUA_IEEE754TRICK
510323530Savg#define LUA_IEEELL
511323530Savg#define LUA_IEEEENDIAN		0
512323530Savg#define LUA_NANTRICK
513323530Savg
514323530Savg/* pentium 64 bits? */
515323530Savg#elif defined(__x86_64)						/* }{ */
516323530Savg
517323530Savg#define LUA_IEEE754TRICK
518323530Savg#define LUA_IEEEENDIAN		0
519323530Savg
520323530Savg#elif defined(__POWERPC__) || defined(__ppc__)			/* }{ */
521323530Savg
522323530Savg#define LUA_IEEE754TRICK
523323530Savg#define LUA_IEEEENDIAN		1
524323530Savg
525323530Savg#else								/* }{ */
526323530Savg
527323530Savg/* assume IEEE754 and a 32-bit integer type */
528323530Savg#define LUA_IEEE754TRICK
529323530Savg
530323530Savg#endif								/* } */
531323530Savg
532323530Savg#endif							/* } */
533323530Savg
534323530Savg/* }================================================================== */
535323530Savg
536323530Savg
537323530Savg
538323530Savg
539323530Savg/* =================================================================== */
540323530Savg
541323530Savg/*
542323530Savg** Local configuration. You can use this space to add your redefinitions
543323530Savg** without modifying the main part of the file.
544323530Savg*/
545323530Savg
546323530Savg#define	getlocaledecpoint() ('.')
547323530Savg
548323530Savg#define abs(x) (((x) < 0) ? -(x) : (x))
549323530Savg
550323530Savg#if !defined(UCHAR_MAX)
551323530Savg#define	UCHAR_MAX (0xff)
552323530Savg#endif
553323530Savg
554323530Savg#endif
555323530Savg
556