Skip to content

Commit

Permalink
call eln2 instead
Browse files Browse the repository at this point in the history
  • Loading branch information
shikokuchuo committed Apr 25, 2024
1 parent 7ef3291 commit fb14833
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
9 changes: 7 additions & 2 deletions src/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,12 @@ SEXP nano_success;
SEXP nano_unresolved;

SEXP nano_precious;
later_fun later2;

later_fun eln2;

void later2(void (*fun)(void *), void *data, double secs) {
eln2(fun, data, secs, 0);
}

static void RegisterSymbols(void) {
nano_AioSymbol = Rf_install("aio");
Expand Down Expand Up @@ -196,7 +201,7 @@ static const R_ExternalMethodDef externalMethods[] = {
void attribute_visible R_init_nanonext(DllInfo* dll) {
RegisterSymbols();
PreserveObjects();
later2 = (later_fun) R_GetCCallable("later", "execLaterNative");
eln2 = (later_fun) R_GetCCallable("later", "execLaterNative2");
R_registerRoutines(dll, NULL, callMethods, NULL, externalMethods);
R_useDynamicSymbols(dll, FALSE);
R_forceSymbols(dll, TRUE);
Expand Down
4 changes: 2 additions & 2 deletions src/nanonext.h
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,8 @@ typedef struct nano_buf_s {
size_t cur;
} nano_buf;

typedef void (*later_fun)(void (*)(void *), void *, double);
extern later_fun later2;
typedef void (*later_fun)(void (*)(void *), void *, double, int);
extern void later2(void (*)(void *), void *, double);

SEXP nano_PreserveObject(SEXP);
void nano_ReleaseObject(SEXP);
Expand Down

0 comments on commit fb14833

Please sign in to comment.