I'm creating a macro for an arm embedded build that parses an xmlfile via parsexml. However, when I am compiling with --os:standalone I can't use xmlparser because it depends on strtabs which has a dependency on os.
I noticed that in strtabs there's a when statement to ignore os for:
when defined(js) or defined(nimscript)
If I apply this diff to strtabs it works:
diff --git a/lib/pure/strtabs.nim b/lib/pure/strtabs.nim
index d9f6bbc54..7b726e134 100644
--- a/lib/pure/strtabs.nim
+++ b/lib/pure/strtabs.nim
@@ -53,7 +53,7 @@ import std/private/since
import
hashes, strutils
-when defined(js) or defined(nimscript):
+when defined(js) or defined(nimscript) or defined(Standalone):
{.pragma: rtlFunc.}
else:
{.pragma: rtlFunc, rtl.}
@@ -301,7 +301,7 @@ proc raiseFormatException(s: string) =
proc getValue(t: StringTableRef, flags: set[FormatFlag], key: string): string =
if hasKey(t, key): return t.getOrDefault(key)
# hm difficult: assume safety in taint mode here. XXX This is dangerous!
- when defined(js) or defined(nimscript):
+ when defined(js) or defined(nimscript) or defined(Standalone):
result = ""
else:
if useEnvironment in flags: result = getEnv(key).string
Does anyone have a suggestion on how to do this w/o patching strtabs this way? Thanks!