Skip to content

Commit

Permalink
Changed to a simpler and more efficient workaround.
Browse files Browse the repository at this point in the history
  • Loading branch information
salass00 committed Oct 2, 2016
1 parent b52d203 commit bb61fa4
Showing 1 changed file with 3 additions and 16 deletions.
19 changes: 3 additions & 16 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,23 +31,13 @@ const char USED verstag[] = VERSTAG " alpha version";

extern struct Interface *INewlib;

/* Workaround for bug in newlib.library < 53.31 */
const unsigned int __newlib_minversion __attribute__((weak,section(".gnu.linkonce.r.__NewlibVersion"))) = (52 << 16) | 20;

int main(int argc, char **argv) {
struct DOSIFace *local_IDOS = NULL;
struct LocaleInfo loc;
int rc;

/* Workaround for weird newlib(?) bug */
if (IDOS == NULL) {
IExec->DebugPrintF("NULL IDOS detected in main(), using workaround code.\n");

local_IDOS = (struct DOSIFace *)OpenInterface("dos.library", 53, "main", 1);
if (local_IDOS == NULL)
return RETURN_FAIL;

IDOS = local_IDOS;
DOSBase = local_IDOS->Data.LibBase;
}

signal(SIGINT, SIG_IGN);
signal(SIGTERM, SIG_IGN);

Expand Down Expand Up @@ -78,9 +68,6 @@ int main(int argc, char **argv) {

FreeLocaleInfo(&loc);

if (local_IDOS != NULL)
CloseInterface((struct Interface *)local_IDOS);

return rc;
}

0 comments on commit bb61fa4

Please sign in to comment.