Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/external/mit/lua/dist/src fix kernel module build



details:   https://anonhg.NetBSD.org/src/rev/28787972f275
branches:  trunk
changeset: 340881:28787972f275
user:      mbalmer <mbalmer%NetBSD.org@localhost>
date:      Thu Oct 08 13:40:16 2015 +0000

description:
fix kernel module build

diffstat:

 external/mit/lua/dist/src/llex.c    |   4 ++--
 external/mit/lua/dist/src/lstrlib.c |   7 +++++--
 external/mit/lua/dist/src/ltable.c  |   4 ++--
 external/mit/lua/dist/src/lvm.c     |  15 ++++++++++++---
 external/mit/lua/dist/src/lvm.h     |   4 ++--
 5 files changed, 23 insertions(+), 11 deletions(-)

diffs (161 lines):

diff -r b08c1aa598d1 -r 28787972f275 external/mit/lua/dist/src/llex.c
--- a/external/mit/lua/dist/src/llex.c  Thu Oct 08 13:21:00 2015 +0000
+++ b/external/mit/lua/dist/src/llex.c  Thu Oct 08 13:40:16 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: llex.c,v 1.5 2015/10/08 13:21:00 mbalmer Exp $ */
+/*     $NetBSD: llex.c,v 1.6 2015/10/08 13:40:16 mbalmer Exp $ */
 
 /*
 ** Id: llex.c,v 2.93 2015/05/22 17:45:56 roberto Exp 
@@ -227,7 +227,7 @@
       if (p[n] == from) p[n] = to;
   }
 }
-
+#endif
 
 #define buff2num(b,o)  (luaO_str2num(luaZ_buffer(b), o) != 0)
 
diff -r b08c1aa598d1 -r 28787972f275 external/mit/lua/dist/src/lstrlib.c
--- a/external/mit/lua/dist/src/lstrlib.c       Thu Oct 08 13:21:00 2015 +0000
+++ b/external/mit/lua/dist/src/lstrlib.c       Thu Oct 08 13:40:16 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: lstrlib.c,v 1.8 2015/10/08 13:21:00 mbalmer Exp $      */
+/*     $NetBSD: lstrlib.c,v 1.9 2015/10/08 13:40:16 mbalmer Exp $      */
 
 /*
 ** Id: lstrlib.c,v 1.229 2015/05/20 17:39:23 roberto Exp 
@@ -886,8 +886,11 @@
 ** by format('%.99f', minfloat), and is equal to 99 + 2 ('-' and '.') +
 ** number of decimal digits to represent minfloat.
 */
+#ifndef _KERNEL
 #define MAX_ITEM       (120 + l_mathlim(MAX_10_EXP))
-
+#else
+#define MAX_ITEM       (120)
+#endif
 
 /* valid flags in a format specification */
 #define FLAGS  "-+ #0"
diff -r b08c1aa598d1 -r 28787972f275 external/mit/lua/dist/src/ltable.c
--- a/external/mit/lua/dist/src/ltable.c        Thu Oct 08 13:21:00 2015 +0000
+++ b/external/mit/lua/dist/src/ltable.c        Thu Oct 08 13:40:16 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ltable.c,v 1.4 2015/10/08 13:21:00 mbalmer Exp $       */
+/*     $NetBSD: ltable.c,v 1.5 2015/10/08 13:40:16 mbalmer Exp $       */
 
 /*
 ** Id: ltable.c,v 2.111 2015/06/09 14:21:13 roberto Exp 
@@ -116,7 +116,7 @@
   }
 }
 #endif
-
+#endif /*_KERNEL */
 
 /*
 ** returns the 'main' position of an element in a table (that is, the index
diff -r b08c1aa598d1 -r 28787972f275 external/mit/lua/dist/src/lvm.c
--- a/external/mit/lua/dist/src/lvm.c   Thu Oct 08 13:21:00 2015 +0000
+++ b/external/mit/lua/dist/src/lvm.c   Thu Oct 08 13:40:16 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: lvm.c,v 1.6 2015/10/08 13:21:00 mbalmer Exp $  */
+/*     $NetBSD: lvm.c,v 1.7 2015/10/08 13:40:16 mbalmer Exp $  */
 
 /*
 ** Id: lvm.c,v 2.245 2015/06/09 15:53:35 roberto Exp 
@@ -39,7 +39,7 @@
 #define MAXTAGLOOP     2000
 
 
-
+#ifndef _KERNEL
 /*
 ** 'l_intfitsf' checks whether a given integer can be converted to a
 ** float without rounding. Used in comparisons. Left undefined if
@@ -66,6 +66,7 @@
 #endif
 
 #endif
+#endif /*_KERNEL */
 
 #ifndef _KERNEL
 /*
@@ -126,8 +127,8 @@
 }
 
 
+#ifndef _KERNEL
 /*
-#ifndef _KERNEL
 ** Try to convert a 'for' limit to an integer, preserving the
 ** semantics of the loop.
 ** (The following explanation assumes a non-negative step; it is valid
@@ -318,9 +319,12 @@
     lua_Integer li = ivalue(l);
     if (ttisinteger(r))
       return li < ivalue(r);  /* both are integers */
+#ifndef _KERNEL
     else  /* 'l' is int and 'r' is float */
       return LTintfloat(li, fltvalue(r));  /* l < r ? */
+#endif
   }
+#ifndef _KERNEL
   else {
     lua_Number lf = fltvalue(l);  /* 'l' must be float */
     if (ttisfloat(r))
@@ -330,6 +334,7 @@
     else  /* without NaN, (l < r)  <-->  not(r <= l) */
       return !LEintfloat(ivalue(r), lf);  /* not (r <= l) ? */
   }
+#endif
 }
 
 
@@ -341,9 +346,12 @@
     lua_Integer li = ivalue(l);
     if (ttisinteger(r))
       return li <= ivalue(r);  /* both are integers */
+#ifndef _KERNEL
     else  /* 'l' is int and 'r' is float */
       return LEintfloat(li, fltvalue(r));  /* l <= r ? */
+#endif
   }
+#ifndef _KERNEL
   else {
     lua_Number lf = fltvalue(l);  /* 'l' must be float */
     if (ttisfloat(r))
@@ -353,6 +361,7 @@
     else  /* without NaN, (l <= r)  <-->  not(r < l) */
       return !LTintfloat(ivalue(r), lf);  /* not (r < l) ? */
   }
+#endif
 }
 
 
diff -r b08c1aa598d1 -r 28787972f275 external/mit/lua/dist/src/lvm.h
--- a/external/mit/lua/dist/src/lvm.h   Thu Oct 08 13:21:00 2015 +0000
+++ b/external/mit/lua/dist/src/lvm.h   Thu Oct 08 13:40:16 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: lvm.h,v 1.4 2015/10/08 13:21:00 mbalmer Exp $  */
+/*     $NetBSD: lvm.h,v 1.5 2015/10/08 13:40:16 mbalmer Exp $  */
 
 /*
 ** Id: lvm.h,v 2.35 2015/02/20 14:27:53 roberto Exp 
@@ -29,7 +29,6 @@
 #endif
 
 
-#ifndef _KERNEL
 /*
 ** You can define LUA_FLOORN2I if you want to convert floats to integers
 ** by flooring them (instead of raising an error if they are not
@@ -40,6 +39,7 @@
 #endif
 
 
+#ifndef _KERNEL
 #define tonumber(o,n) \
        (ttisfloat(o) ? (*(n) = fltvalue(o), 1) : luaV_tonumber_(o,n))
 #else /* _KERNEL */



Home | Main Index | Thread Index | Old Index