Commit Graph

6 Commits

Author SHA1 Message Date
Stephen Heumann 27fc6836cc Fix div() and ldiv() to return properly-signed remainders.
They could previously give the wrong sign on the remainder in certain cases where one or both of the arguments were negative, because they were using the wrong condition to decide whether to negate it.
2018-09-10 17:09:28 -05:00
Stephen Heumann efab82784d Add _Exit() function from C99.
This exits the programs without calling atexit functions and possibly without doing other clean-up operations. In ORCA/C, it is functionally identical to _exit().
2018-09-09 23:23:19 -05:00
Stephen Heumann 6e97906678 Make strtol/strtoul return LONG_MIN/LONG_MAX/ULONG_MAX for out-of-range values.
This fixes #10.

There are still issues with the end pointer value generated in error cases.
2018-03-13 22:11:40 -05:00
Stephen Heumann 7abdfc9beb Make system(NULL) detect whether a command processor is available.
Previously, it just ran an Execute shell call with NULL as the command-line pointer.

The fix is to still call Execute, but with an empty string as the command line, and then check if the call gave an error. If running under plain GS/OS, this gives an error for an unknown system call, whereas both ORCA/APW and GNO shells will return with no error in this case. (Golden Gate doesn't implement the Execute shell call, so it also gives an error and will report no command processor available.)

This fixes issue #25.
2018-03-13 17:49:49 -05:00
Kelvin Sherlock 578bda8439 CR -> LF 2017-10-31 13:14:07 -04:00
mikew50 954c3a02b5 ORCA libraries, from the Opus ][ CD 2017-10-01 18:00:58 -06:00