Skip to content

Commit ceea565

Browse files
committed
Failed experiment providing get/setFFILastError
1 parent b651d85 commit ceea565

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

platforms/Cross/vm/sqVirtualMachine.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,13 @@ struct VirtualMachine* sqGetInterpreterProxy(void)
381381
VM->fileTimesInUTC = fileTimesInUTC;
382382
VM->processOSErrInstVarOffset = processOSErrInstVarOffset;
383383
VM->activeProcess = activeProcess;
384+
# if COGMTVM
385+
VM->getFFILastError = getFFILastError;
386+
VM->setFFILastError = setFFILastError;
387+
# else
388+
VM->getFFILastError = (sqInt (*)(void))abortIfInvokedForFLE;
389+
VM->setFFILastError = (void (*)(sqInt))abortIfInvokedForFLE;
390+
# endif
384391
#endif
385392
return VM;
386393
}

platforms/Cross/vm/sqVirtualMachine.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,8 @@ typedef struct VirtualMachine {
382382
sqInt (*fileTimesInUTC)(void); /* for FilePlugin et al */
383383
sqInt (*processOSErrInstVarOffset)(void); /* for ThreadedFFIPlugin/SqueakFFIPrims */
384384
sqInt (*activeProcess)(void); /* for ThreadedFFIPlugin/SqueakFFIPrims */
385+
sqInt (*getFFILastError)(void); /* for ThreadedFFIPlugin/SqueakFFIPrims */
386+
void (*setFFILastError)(sqInt err); /* for ThreadedFFIPlugin/SqueakFFIPrims */
385387
#endif
386388
} VirtualMachine;
387389

@@ -611,6 +613,12 @@ sqInt fileTimesInUTC(void);
611613
sqInt processOSErrInstVarOffset(void);
612614
sqInt primitiveFailForwithSecondary(sqInt reasonCode,sqLong extraErrorCode);
613615
sqInt activeProcess(void);
616+
# if COGMTVM
617+
sqInt getFFILastError(void);
618+
void setFFILastError(sqInt err);
619+
# else
620+
void abortIfInvokedForFLE(void);
621+
# endif
614622
#endif
615623

616624
void *ioLoadFunctionFrom(char *fnName, char *modName);

0 commit comments

Comments
 (0)