note 125128 added to ffi.load
| From: | jungmann0 at gmail dot com | Date: | Sat, 20 Jun 2020 07:20:35 +0000 |
| Subject: | note 125128 added to ffi.load | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-214779@lists.php.net to get a copy of this message | ||
Since #include's and #define's other than FFI_LIB and FFI_SCOPE are not supported in the
header, you may want to use the C preprocessor to pre-process your headers in order to resolve all
#include's and macros.
I use -D"__attribute__(ARGS)=" to remove function attributes as well, which are not
supported by FFI either.
This is my script:
echo '#define FFI_SCOPE "YOUR_SCOPE"' > header-ffi.h
echo '#define FFI_LIB "/path/to/your_lib.so"' >> header-ffi.h
cpp -P -C -D"__attribute__(ARGS)=" header_original >> header-ffi.h
----
Server IP: 45.112.84.4
Probable Submitter: 103.51.166.36 (proxied: 2a02:908:1086:35a0:a64e:31ff:fe42:42b8)
----
Manual Page -- http://php.net/manual/en/ffi.load.php
Edit -- https://master.php.net/note/edit/125128
Del: integrated -- https://master.php.net/note/delete/125128/integrated
Del: useless -- https://master.php.net/note/delete/125128/useless
Del: bad code -- https://master.php.net/note/delete/125128/bad+code
Del: spam -- https://master.php.net/note/delete/125128/spam
Del: non-english -- https://master.php.net/note/delete/125128/non-english
Del: in docs -- https://master.php.net/note/delete/125128/in+docs
Del: other reasons-- https://master.php.net/note/delete/125128
Reject -- https://master.php.net/note/reject/125128
Search -- https://master.php.net/manage/user-notes.php