ELSE
RTExceptions.Raise(ORD(M2EXCEPTION.coException),
ADR(__FILE__), __LINE__, __COLUMN__, ADR(__FUNCTION__),
- ADR('current coroutine is not in the exceptional execution state'))
+ ADR('current coroutine is not in the exceptional execution state')) ;
+ RETURN VAL (ExceptionNumber, M2EXCEPTION.exException)
END
END CurrentNumber ;
IF dtp=NIL
THEN
RAISE(iochan, ORD(hardDeviceError),
- 'IOChan.SetReadResult: device table ptr is NIL')
+ 'IOChan.SetReadResult: device table ptr is NIL') ;
+ RETURN IOConsts.notKnown
ELSE
RETURN( dtp^.result )
END
PROCEDURE CurrentFlags (cid: ChanId) : ChanConsts.FlagSet ;
(* Returns the set of flags that currently apply to the channel cid. *)
VAR
- did: IOLink.DeviceId ;
- dtp: IOLink.DeviceTablePtr ;
+ did : IOLink.DeviceId ;
+ dtp : IOLink.DeviceTablePtr ;
+ empty: ChanConsts.FlagSet ;
BEGIN
CheckValid(cid) ;
did := RTio.GetDeviceId(cid) ;
IF dtp=NIL
THEN
RAISE(iochan, ORD(hardDeviceError),
- 'IOChan.SetReadResult: device table ptr is NIL')
+ 'IOChan.SetReadResult: device table ptr is NIL') ;
+ empty := ChanConsts.FlagSet {} ;
+ RETURN empty
ELSE
RETURN( dtp^.flags )
END
IF dtp=NIL
THEN
RAISE(iochan, ORD(hardDeviceError),
- 'IOChan.DeviceError: device table ptr is NIL')
+ 'IOChan.DeviceError: device table ptr is NIL') ;
+ RETURN DeviceError (invalid)
ELSE
RETURN( dtp^.errNum )
END
RETURN( RTio.GetDevicePtr(cid) )
ELSE
EXCEPTIONS.RAISE(iolink, ORD(IOChan.wrongDevice),
- 'IOLink.DeviceTablePtrValue: channel does belong to device')
+ 'IOLink.DeviceTablePtrValue: channel does belong to device') ;
+ RETURN NIL
END
END
END DeviceTablePtrValue ;
RETURN( doValueReal(str) )
ELSE
EXCEPTIONS.RAISE(realConv, ORD(invalid),
- 'LongConv.' + __FUNCTION__ + ': real number is invalid')
+ 'LongConv.' + __FUNCTION__ + ': real number is invalid') ;
+ RETURN 0.0
END
END ValueReal ;
PROCEDURE HaltC (description, filename, function: ADDRESS; line: CARDINAL) <* noreturn *> ;
BEGIN
- ErrorMessageC (description, filename, line, function)
+ ErrorMessageC (description, filename, line, function) ;
+ exit (1)
END HaltC ;
to stderr and calls exit (1).
*)
-PROCEDURE Halt (description, filename, function: ARRAY OF CHAR; line: CARDINAL) ;
+PROCEDURE Halt (description, filename, function: ARRAY OF CHAR; line: CARDINAL) <* noreturn *> ;
BEGIN
- ErrorMessage (description, filename, line, function)
+ ErrorMessage (description, filename, line, function) ;
+ exit (1)
END Halt ;
memcpy (function, function_, _function_high+1);
M2RTS_ErrorMessage ((const char *) description, _description_high, (const char *) filename, _filename_high, line, (const char *) function, _function_high);
+ libc_exit (1);
}
extern "C" void M2RTS_HaltC (void * description, void * filename, void * function, unsigned int line)
{
ErrorMessageC (description, filename, line, function);
+ libc_exit (1);
}