mirror of
https://github.com/Nexoniarz/Finch.git
synced 2026-11-03 00:44:27 +00:00
static inline C functions (mingw's printf and time), macOS libraries that call their host, lld's missing-library message
- a static inline function in a header is called through a pointer a small C file keeps (void *finch_inl_f = &f), built with the program's include folders and cached - --shared on macOS links with -undefined dynamic_lookup, as a .so does on Linux - "unable to find library -lx" (lld, MinGW) gives the library-not-found advice - the language server test shows the index records when alias completion fails Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016GzNP6r8dg6WDxUVZy8wjL
This commit is contained in:
parent
72e96a3f71
commit
ff72f68804
8 changed files with 81 additions and 13 deletions
|
|
@ -204,7 +204,12 @@ e3 = src3.replace(" print(", " pt.\n print(")
|
|||
c.notify("textDocument/didChange", {"textDocument": {"uri": uri3, "version": 2}, "contentChanges": [{"text": e3}]})
|
||||
comp = c.request("textDocument/completion", {"textDocument": {"uri": uri3}, "position": {"line": 3, "character": 7}})
|
||||
labels = [i["label"] for i in comp["items"]]
|
||||
check("completion: a module under another name", "base" in labels and "join" in labels, labels)
|
||||
ok3 = "base" in labels and "join" in labels
|
||||
if not ok3: # show what the compiler's index says about the module, to see where the names differ
|
||||
import subprocess
|
||||
idx = subprocess.run([FINCH, "index", path3], capture_output=True, text=True).stdout
|
||||
labels = [l for l in idx.splitlines() if l.startswith("@I") or (l.startswith("@F") and "base" in l)][:6]
|
||||
check("completion: a module under another name", ok3, labels)
|
||||
|
||||
c.request("shutdown", None)
|
||||
c.notify("exit", None)
|
||||
|
|
|
|||
|
|
@ -26,4 +26,5 @@ fn main() {
|
|||
print(abs(-2.5), abs(-3), min(EV_KEY, 7)) // Finch's abs, not C's int-only one
|
||||
bg := RAYWHITE // #define RAYWHITE (Color){ 245, 245, 245, 255 }
|
||||
print(bg.r, bg.a, DARK.g, DARK.a, HALF_UP.x, HALF_UP.y)
|
||||
print(twice(21)) // static inline in the header
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,3 +6,4 @@ true 32
|
|||
0.5
|
||||
2.5 3 7
|
||||
245 255 20 0 0.5 -1
|
||||
42
|
||||
|
|
|
|||
|
|
@ -36,3 +36,6 @@ static inline int fill_key(Event *e, int key) {
|
|||
return 1;
|
||||
}
|
||||
int poll_event(Event *e);
|
||||
|
||||
static inline int twice(int x) { return 2 * x; }
|
||||
static inline int sum_all(int n, ...) { return n; }
|
||||
|
|
|
|||
Loading…
Reference in a new issue