--- base/eval.c.orig	2023-07-25 13:00:01.000000000 +0700
+++ base/eval.c	2023-09-14 03:39:56.000000000 +0700
@@ -13,6 +13,7 @@
  */
 
 #include <stdio.h>
+#include <stdlib.h> /* free */
 
 #ifdef TCL_IRSIM
 #include <tk.h>

--- analyzer/defaults.c.orig	2020-02-25 04:25:02.000000000 +0700
+++ analyzer/defaults.c	2023-09-14 03:42:13.000000000 +0700
@@ -12,9 +12,8 @@
  *     *********************************************************************
  */
 
-#ifdef LINUX
 #include <string.h>
-#endif
+
 #include "ana.h"
 #include "defs.h"
 #include "ana_glob.h"

--- usersubckt/subckt.c.orig	2022-09-17 13:00:01.000000000 +0700
+++ usersubckt/subckt.c	2023-09-14 03:45:23.000000000 +0700
@@ -1,5 +1,8 @@
 #include <stdio.h>
 #include <stdlib.h>
+#include <string.h>
+#include <strings.h>
+#include <ctype.h>
 #include <math.h>
 
 #ifdef TCL_IRSIM

--- tcltk/tkAnalyzer.c.orig	2020-02-25 04:25:02.000000000 +0700
+++ tcltk/tkAnalyzer.c	2023-09-14 03:46:51.000000000 +0700
@@ -11,10 +11,7 @@
 
 #include <stdio.h>
 #include <stdlib.h>
-
-#ifdef LINUX
 #include <string.h>  /* for strncmp() */
-#endif
 
 #include <tk.h>
 
--- tcltk/tclirsim.c.orig	2023-09-14 04:29:50.000000000 +0700
+++ tcltk/tclirsim.c	2023-09-14 04:30:29.000000000 +0700
@@ -20,6 +20,27 @@
 
 #include "rsim.h"
 
+extern	FILE  *logfile;
+
+public void logprint( s )
+  register char  *s;
+  {
+    static int  docomment = 1;
+
+    while( *s != '\0' )
+      {
+	if( docomment )
+	  {
+	    (void) putc( '|', logfile );
+	    (void) putc( ' ', logfile );
+	    docomment = 0;
+	  }
+	(void) putc( *s, logfile );
+	if( *s++ == '\n' )
+	    docomment = 1;
+      }
+  }
+
 /*
  * Handling of VA_COPY.  These variables are set by the configuration
  * script.  Some systems define va_copy, some define __va_copy, and