aboutsummaryrefslogtreecommitdiff
path: root/lundump.h
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>1998-06-18 13:52:04 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>1998-06-18 13:52:04 -0300
commit112c9d53ab47e77fd09d4ecb9b11d432ed906c88 (patch)
treef2fb14e67049257686b84ee369e1ecbebbe491be /lundump.h
parent07894514587e5cada05c5ea85ee714f85eec9127 (diff)
downloadlua-112c9d53ab47e77fd09d4ecb9b11d432ed906c88.tar.gz
lua-112c9d53ab47e77fd09d4ecb9b11d432ed906c88.tar.bz2
lua-112c9d53ab47e77fd09d4ecb9b11d432ed906c88.zip
new version by lhf
Diffstat (limited to 'lundump.h')
-rw-r--r--lundump.h38
1 files changed, 21 insertions, 17 deletions
diff --git a/lundump.h b/lundump.h
index 7e5b286c..d9bc8668 100644
--- a/lundump.h
+++ b/lundump.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lundump.h,v 1.5 1998/02/06 20:05:39 lhf Exp lhf $ 2** $Id: lundump.h,v 1.6 1998/06/13 16:54:15 lhf Exp $
3** load pre-compiled Lua chunks 3** load pre-compiled Lua chunks
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -22,32 +22,36 @@ TProtoFunc* luaU_undump1(ZIO* Z); /* load one chunk */
22#define ID_STR 'S' 22#define ID_STR 'S'
23#define ID_FUN 'F' 23#define ID_FUN 'F'
24 24
25#define ID_INT4 'l' 25/* number representation */
26#define ID_REAL4 'f' 26#define ID_INT4 'l' /* 4-byte integers */
27#define ID_REAL8 'd' 27#define ID_REAL4 'f' /* 4-byte reals */
28#define ID_NATIVE '?' 28#define ID_REAL8 'd' /* 8-byte reals */
29#define ID_NATIVE '?' /* whatever your machine uses */
29 30
30/* 31/*
31* use a multiple of PI for testing number representation. 32* use a multiple of PI for testing number representation.
32* multiplying by 10E8 gives notrivial integer values. 33* multiplying by 1E8 gives notrivial integer values.
33*/ 34*/
34#define TEST_NUMBER 3.14159265358979323846E8 35#define TEST_NUMBER 3.14159265358979323846E8
35 36
36/* LUA_NUMBER */ 37/* LUA_NUMBER
37/* if you change the definition of real, make sure you set ID_NUMBER 38* choose one below for the number representation in precompiled chunks.
38* accordingly, specially if sizeof(long)!=4. 39* the default is ID_REAL8 because the default for LUA_NUM_TYPE is double.
40* if your machine does not use IEEE 754, use ID_NATIVE.
41* the next version will support conversion to/from IEEE 754.
42*
43* if you change LUA_NUM_TYPE, make sure you set ID_NUMBER accordingly,
44* specially if sizeof(long)!=4.
39* for types other than the ones listed below, you'll have to write your own 45* for types other than the ones listed below, you'll have to write your own
40* dump and undump routines. 46* dump and undump routines.
41*/ 47*/
42 48
43#if real==float 49#define ID_NUMBER ID_REAL8
44 #define ID_NUMBER ID_REAL4 50
45#elif real==double 51#if 0
46 #define ID_NUMBER ID_REAL8 52#define ID_NUMBER ID_REAL4
47#elif real==long 53#define ID_NUMBER ID_INT4
48 #define ID_NUMBER ID_INT4 54#define ID_NUMBER ID_NATIVE
49#else
50 #define ID_NUMBER ID_NATIVE
51#endif 55#endif
52 56
53#endif 57#endif