annotate lua/luadc/test.lua @ 62:4a9f6c7c09c1

- fix inccorect overflow errors for int (and long on LLP64 systems)
author Tassilo Philipp
date Sat, 18 May 2024 15:33:54 +0200
parents 0cfcc391201f
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
1 require "package"
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
2 pf = package.loadlib("luadc","luadc_open")
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
3 pf()
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
4
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
5 print(dc.C_DEFAULT)
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
6 print(dc.C_X86_WIN32_STD)
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
7
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
8 dc.mode(dc.C_DEFAULT)
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
9
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
10 clib = dc.load("msvcrt")
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
11 f = dc.find(clib,"sqrt")
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
12 x = dc.call(f,"d)d",144)
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
13 print(x)
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
14
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
15
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
16 dc.mode(dc.C_X86_WIN32_STD)
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
17
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
18 user32 = dc.load("user32")
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
19 f = dc.find(user32,"MessageBoxA")
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
20 x = dc.call(f,"iSSi)v", 0, "Hello", "World", 0)
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
21
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
22