First you need to set FFI to the image via Monticello.
The FFI package is located at http://source.squeak.org/FFI.html
You need to install "FFI-Pools" first, then "FFI-Kernel". Then you can download "FFI-Tests" and "FFI-Example".
Once FFI is installed on the image, the correct syntax will be something like this:
add: a to: b " ( int ) add (int a, int b) ; " <cdecl: long 'add' ( long long ) module: 'mydll'> ^ self externalCallFailed
You do not specify parameter names - they implicitly occupy the same position as the smalltalk method.
You have to replace int with long ones - this is the same on supported 32-bit platforms.
EDIT to download the FFI package to Squeak, you can enter and execute (do this) in the workspace:
(Installer repository: 'http://source.squeak.org/FFI') install: 'FFI-Pools'; install: 'FFI-Kernel'; install: 'FFI-Tests'; install: 'FFI-Examples'.
source share