mirror of https://github.com/rusefi/lua.git
new option '=' (native endian) for pack/unpack
This commit is contained in:
parent
4542fb9f78
commit
dcfc3c9405
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
** $Id: lstrlib.c,v 1.209 2014/10/28 18:23:31 roberto Exp roberto $
|
** $Id: lstrlib.c,v 1.210 2014/10/30 18:53:28 roberto Exp roberto $
|
||||||
** Standard library for string operations and pattern-matching
|
** Standard library for string operations and pattern-matching
|
||||||
** See Copyright Notice in lua.h
|
** See Copyright Notice in lua.h
|
||||||
*/
|
*/
|
||||||
|
@ -1086,6 +1086,7 @@ static KOption getoption (Header *h, const char **fmt, int *size) {
|
||||||
case ' ': return Knop;
|
case ' ': return Knop;
|
||||||
case '<': h->islittle = 1; return Knop;
|
case '<': h->islittle = 1; return Knop;
|
||||||
case '>': h->islittle = 0; return Knop;
|
case '>': h->islittle = 0; return Knop;
|
||||||
|
case '=': h->islittle = nativeendian.little; return Knop;
|
||||||
case '!': h->maxalign = getnumlimit(h, fmt, MAXALIGN); return Knop;
|
case '!': h->maxalign = getnumlimit(h, fmt, MAXALIGN); return Knop;
|
||||||
default: {
|
default: {
|
||||||
luaL_error(h->L, "invalid format option '%c'", opt);
|
luaL_error(h->L, "invalid format option '%c'", opt);
|
||||||
|
|
Loading…
Reference in New Issue