X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=perl%2FOpenSSL.xs;h=6ef66ccc1eedfe10cd779d4d3f5af18bf11c10a5;hb=b4f682d32fb8bf375fd0c8edce6d113dfdf1c6ba;hp=9af3113f76b0abb43d2a7d4deeaf5609b46decc0;hpb=84107e6ca812b1325907596b6a5bfa9080a16a92;p=oweals%2Fopenssl.git diff --git a/perl/OpenSSL.xs b/perl/OpenSSL.xs index 9af3113f76..6ef66ccc1e 100644 --- a/perl/OpenSSL.xs +++ b/perl/OpenSSL.xs @@ -64,17 +64,46 @@ ex_cleanup(obj, data, ad, idx, argl, argp) MODULE = OpenSSL PACKAGE = OpenSSL +PROTOTYPES: ENABLE + BOOT: boot_bio(); boot_cipher(); boot_digest(); boot_err(); boot_ssl(); - boot_OpenSSL__BN(); - boot_OpenSSL__BIO(); - boot_OpenSSL__Cipher(); - boot_OpenSSL__MD(); - boot_OpenSSL__ERR(); - boot_OpenSSL__SSL(); - boot_OpenSSL__X509(); + + /* */ + /* The next macro is the completely correct way to call a C */ + /* function that uses perl calling conventions but is not */ + /* registered with perl. */ + /* */ + /* The second macro seems to work for this context. (We just */ + /* need a mark for the called function since we don't have */ + /* any local variables and what-not.) */ + /* */ + /* Unfortunately, we need to do this because these boot_* */ + /* functions are auto-generated by xsubpp and are normally */ + /* called from DyncLoader, but we're pulling them in here. */ + /* */ +#define FULL_callBootFunc(func) { \ + dSP; \ + ENTER; \ + SAVETMPS; \ + PUSHMARK(SP); \ + func(); \ + FREETMPS; \ + LEAVE; \ + } +#define callBootFunc(func) { \ + PUSHMARK(SP); \ + func(); \ + } + callBootFunc(boot_OpenSSL__BN); + callBootFunc(boot_OpenSSL__BIO); + callBootFunc(boot_OpenSSL__Cipher); + callBootFunc(boot_OpenSSL__MD); + callBootFunc(boot_OpenSSL__ERR); + callBootFunc(boot_OpenSSL__SSL); + callBootFunc(boot_OpenSSL__X509);