aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/include
diff options
context:
space:
mode:
authorNoam Preil <noam@pixelhero.dev>2025-12-10 12:18:17 +0000
committerNoam Preil <noam@pixelhero.dev>2025-12-10 12:18:17 +0000
commit2f69678f2ffc99304140335f2568c08d15847754 (patch)
tree2f7fa79a275c989b1d9ca67a9e7d164928e86c98 /src/include
parentMerge pull request #1678 from tw4452852/push-swmvxuxkrvsx (diff)
9front port
Diffstat (limited to 'src/include')
-rw-r--r--src/include/janet.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/include/janet.h b/src/include/janet.h
index b99d547a..4b47a7ae 100644
--- a/src/include/janet.h
+++ b/src/include/janet.h
@@ -113,6 +113,8 @@ extern "C" {
#endif
/* Check 64-bit vs 32-bit */
+#ifndef JANET_64
+#ifndef JANET_32
#if ((defined(__x86_64__) || defined(_M_X64)) \
&& (defined(JANET_POSIX) || defined(JANET_WINDOWS))) \
|| (defined(_WIN64)) /* Windows 64 bit */ \
@@ -128,6 +130,8 @@ extern "C" {
#else
#define JANET_32 1
#endif
+#endif
+#endif
/* Check big endian */
#if defined(__LITTLE_ENDIAN__) || \
@@ -301,6 +305,10 @@ extern "C" {
#define JANET_STACK_MAX 0x7fffffff
#endif
+#ifdef JANET_PLAN9
+#undef NAN
+#endif
+
/* Use nanboxed values - uses 8 bytes per value instead of 12 or 16.
* To turn of nanboxing, for debugging purposes or for certain
* architectures (Nanboxing only tested on x86 and x64), comment out
@@ -667,6 +675,8 @@ JANET_API void janet_stream_level_triggered(JanetStream *stream);
* signals. Define them here */
#ifdef JANET_WINDOWS
typedef long JanetAtomicInt;
+#elif defined(JANET_PLAN9)
+typedef long JanetAtomicInt;
#else
typedef int32_t JanetAtomicInt;
#endif
@@ -1138,6 +1148,17 @@ struct JanetFunction {
typedef struct JanetParseState JanetParseState;
typedef struct JanetParser JanetParser;
+typedef int (*Consumer)(JanetParser *p, JanetParseState *state, uint8_t c);
+
+struct JanetParseState {
+ int32_t counter;
+ int32_t argn;
+ int flags;
+ size_t line;
+ size_t column;
+ Consumer consumer;
+};
+
enum JanetParserStatus {
JANET_PARSE_ROOT,
JANET_PARSE_ERROR,