From c39e85da6326aa344d4c2cd15073661d85e691b5 Mon Sep 17 00:00:00 2001 From: dtrg Date: Fri, 3 Feb 2006 22:23:11 +0000 Subject: [PATCH] Modernised usage of system header files. Changed the patch buffer (which allowed the library path to be modified with a hex editor) to an environment variable instead. --- util/LLgen/src/machdep.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/util/LLgen/src/machdep.c b/util/LLgen/src/machdep.c index 8214b09de..0c9dcbf18 100644 --- a/util/LLgen/src/machdep.c +++ b/util/LLgen/src/machdep.c @@ -16,6 +16,8 @@ * Machine dependant things */ +#include +#include # include "types.h" # ifndef NORCSID @@ -49,9 +51,6 @@ RENAME(x,y) string x,y; { #endif } -/* to make it easier to patch ... */ -char libdir[256] = LIBDIR; - string libpath(s) string s; { /* Must deliver a full pathname to the library file "s" */ @@ -61,6 +60,9 @@ libpath(s) string s; { p_mem alloc(); string strcpy(), strcat(); + char* libdir = getenv("LLGEN_LIB_DIR"); + if (!libdir) + libdir = LIBDIR; length = strlen(libdir) + strlen(s) + 2; p = (string) alloc((unsigned) length); strcpy(p,libdir); -- 2.34.1