shithub: 9ficl

Download patch

ref: 7c76dac1b268038f567939a70a18228e790a5cbc
parent: 67757267d0b9c6b15a0f9a87abab74ab152d9b09
author: grobe0ba <grobe0ba@tcp80.org>
date: Tue Aug 2 09:09:00 EDT 2022

Functional build of FICL.

--- a/ficl.h
+++ b/ficl.h
@@ -163,7 +163,7 @@
 	#include "ficlplatform/ansi.h"
 #elif defined(_WIN32)
 	#include "ficlplatform/win32.h"
-#elif defined(unix) || defined(__unix__) || defined(__unix)
+#elif defined(unix) || defined(__unix__) || defined(__unix) || defined(__plan9__)
 	#include "ficlplatform/unix.h"
 #else /* catch-all */
 	#include "ficlplatform/ansi.h"
@@ -212,7 +212,7 @@
 ** (see ficlplatform/win32.c and ficlplatform/unix.c for example)
 */
 #if !defined (FICL_WANT_PLATFORM)
-#define FICL_WANT_PLATFORM (0)
+#define FICL_WANT_PLATFORM (1)
 #endif /* FICL_WANT_PLATFORM */
 
 
@@ -287,7 +287,7 @@
 ** and prefix.fr (if included as part of softcore.c)
 */
 #if !defined FICL_WANT_EXTENDED_PREFIX
-#define FICL_WANT_EXTENDED_PREFIX (0)
+#define FICL_WANT_EXTENDED_PREFIX (1)
 #endif /* FICL_WANT_EXTENDED_PREFIX */
 
 /*
@@ -389,7 +389,7 @@
 ** String constant describing the current operating system.
 */
 #if !defined (FICL_PLATFORM_OS)
-#define FICL_PLATFORM_OS              "unknown"
+#define FICL_PLATFORM_OS              "plan9"
 #endif
 
 /*
@@ -437,7 +437,7 @@
 ** in the absence of another keyword.
 */
 #if !defined FICL_PLATFORM_INLINE
-#define FICL_PLATFORM_INLINE static
+#define FICL_PLATFORM_INLINE static inline
 #endif /* !defined FICL_PLATFORM_INLINE */
 
 /*
--- a/ficlplatform/unix.h
+++ b/ficlplatform/unix.h
@@ -4,9 +4,6 @@
 
 #define FICL_WANT_PLATFORM (1)
 
-#define FICL_PLATFORM_OS              "unix"
-#define FICL_PLATFORM_ARCHITECTURE    "unknown"
-
 #define FICL_PLATFORM_BASIC_TYPES     (1)
 #if defined(__amd64__) || defined(__alpha__)
 #define FICL_PLATFORM_ALIGNMENT       (8)
--- a/mkfile
+++ b/mkfile
@@ -10,5 +10,6 @@
 	mk -f mkfile.lib install
 
 clean:
+	cd softcore && mk clean && cd ..
 	mk -f mkfile.bin clean
 	mk -f mkfile.lib clean
--- a/mkfile.bin
+++ b/mkfile.bin
@@ -1,6 +1,6 @@
 </amd64/mkfile
 
-CFLAGS=-I. -D_POSIX_SOURCE -D_SUSV2_SOURCE
+CFLAGS=-I. -D__amd64__ -D__plan9__ -DFICL_PLATFORM_ARCHITECTURE="$objtype" -D_POSIX_SOURCE -D_SUSV2_SOURCE
 CC=pcc
 
 BIN=ficl
@@ -20,4 +20,4 @@
 	pcc $CFLAGS -c -o $target $stem.c
 
 clean:V:
-	rm -f ficl main.$O
+	rm -f ficl main.$O $O.out
--- a/mkfile.lib
+++ b/mkfile.lib
@@ -1,6 +1,6 @@
 </amd64/mkfile
 
-CFLAGS=-I. -D_POSIX_SOURCE -D_SUSV2_SOURCE
+CFLAGS=-I. -D__amd64__ -D__plan9__ -DFICL_PLATFORM_ARCHITECTURE="$objtype" -D_POSIX_SOURCE -D_SUSV2_SOURCE
 CC=pcc
 
 LIB=libficl.a