ThePhD / sol2

Sol3 (sol2 v3.0) - a C++ <-> Lua API wrapper with advanced features and top notch performance - is here, and it's great! Documentation:
http://sol2.rtfd.io/
MIT License
4.06k stars 492 forks source link

in sol3 an error occurs when working with 64-bit numbers #1553

Closed S1NGer-iwni closed 7 months ago

S1NGer-iwni commented 7 months ago

I work with lua 5.3 and sol3. When working with 64-bit numbers, an error occurs, but if I use luajit, then there is no error, AFAIK lua 5.3 supports 64-bit numbers, how can I fix this problem?

error text: sol: syntax error: [string "return 10000152ull"]:1: expected near 'ull' P.S. unfortunately I don't have the opportunity to use luajit on a permanent basis

Rochet2 commented 7 months ago

Lua 5.3 supports 64-bit SIGNED integers (ref). So unsigned integers are not supported and return 10000152ull is not valid lua as you can see from the error.

Luajit has its own support for these integers. While they appear to be a part of the language, they are actually wrapped into cdata objects. See this.

Some alternatives are outlined in here.

Also, the wrapper approach is looked at here as the customization points allowed one to customize how a type is passed into and out of sol.

S1NGer-iwni commented 7 months ago

okay thx