Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow use with R_forceSymbols #239

Open
richfitz opened this issue Sep 3, 2021 · 1 comment
Open

Allow use with R_forceSymbols #239

richfitz opened this issue Sep 3, 2021 · 1 comment

Comments

@richfitz
Copy link
Member

richfitz commented Sep 3, 2021

This fails because deSolve will not accept function pointers of this type. Get this working with dde then try and get this ported to work with deSolve - doing this will help with getting odin and odin.dust to cohabit more gracefully as cpp11 adds this

@richfitz
Copy link
Member Author

Doing this appears hard as we want to write:

SEXP registered_address(SEXP ptr) {
  R_RegisteredNativeSymbol *sym =
    (R_RegisteredNativeSymbol *) R_ExternalPtrAddr(ptr);
  return sym->symbol.c->fun;
}

but this requires definitions that are in R's src/include/Rdynpriv.h

typedef struct {
    char       *name;
    DL_FUNC     fun;
    int         numArgs;

    R_NativePrimitiveArgType *types;   
} Rf_DotCSymbol;

struct Rf_RegisteredNativeSymbol {
    NativeSymbolType type;
    union {
        Rf_DotCSymbol        *c;
        Rf_DotCallSymbol     *call;
        Rf_DotFortranSymbol  *fortran;
        Rf_DotExternalSymbol *external;
    } symbol;
    DllInfo *dll;
};

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant