Closed barrybingo closed 4 years ago
yes, the declarations in https://docs.microsoft.com/es-es/cpp/c-runtime-library/reference/findfirst-functions?view=vs-2019 use intptr_t (8bytes on 64 bits and 4 bytes on 32bits)
What I dont understand is why int was working correctly for me on 32 and 64bits
byte luck? I'm using luaJit 2.1.0-beta3 x64 and it never once worked for me in but I've only been using this module since today.
Doing a directory list the findfirst works but then luaJIT silently terminates. Running in VS2019 debugger caught an exception in findnext so that's where the problem was, which isn't supprising considering.
I can't see how it ever worked for you, but I don't know the history of that API so it might have changed somewhere.
Thanks!!
np
Though I've had a thought; you used a struct to house the 32bit int
local dir_type = ffi.metatype("struct {int handle;}",
and if this struct was padded then the code would work fine. Maybe some compiler option gave it extra size.
Spacewander's repo has removed windows support so this seems to be the repo for all machines.
note that intptr_t on 32 bit machines is int so that code is unaffected