Skip to content

Commit 0c8a5d0

Browse files
authored
Merge pull request #13 from Ferret-Language/unions
Unions
2 parents 09d7cbd + d7cbbec commit 0c8a5d0

61 files changed

Lines changed: 397 additions & 1790 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/release.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,15 @@ jobs:
1313
fail-fast: false
1414
matrix:
1515
include:
16+
# Linux x86_64
1617
- runner: ubuntu-latest
18+
# Linux ARM64
19+
- runner: ubuntu-24.04-arm
20+
# macOS ARM64 (Apple Silicon)
1721
- runner: macos-14
22+
# macOS x86_64 (Intel)
23+
- runner: macos-13
24+
# Windows x86_64
1825
- runner: windows-latest
1926
steps:
2027
- name: Checkout

0.fer

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import "std/io";
2+
3+
type Point struct {
4+
.X: f64,
5+
.Y: f64
6+
};
7+
8+
fn main() {
9+
let empty : Point = { .X = 1.2 };
10+
}

Ferret

-224 Bytes
Binary file not shown.

app

-224 Bytes
Binary file not shown.

ferret_libs/std/math.fer.ast.json

Lines changed: 0 additions & 243 deletions
This file was deleted.

internal/codegen/build.go

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,9 @@ func applyLdDefaults(opts *BuildOptions) error {
327327
case "android":
328328
return fmt.Errorf("android builds are not supported here; use install-termux.sh")
329329
case "windows":
330+
// Windows uses PE format - no dynamic linker needed (unlike ELF on Linux).
331+
// The C runtime is provided by libmsvcrt (linked in DefaultBuildOptions).
332+
// We don't add -lc because Windows doesn't have a separate libc.
330333
crt2, crtbegin, crtend := findWindowsCrtObjects()
331334
if crt2 == "" || crtbegin == "" || crtend == "" {
332335
return fmt.Errorf("ld: missing C runtime objects; set FERRET_LD_CRT2, FERRET_LD_CRTBEGIN, and FERRET_LD_CRTEND")
@@ -491,6 +494,26 @@ func windowsLibDirs() []string {
491494
if tc := toolchainLibDir(); tc != "" {
492495
dirs = append(dirs, tc)
493496
}
497+
498+
// Try to get library directories from gcc
499+
if cc := resolveCCompiler(); cc != "" {
500+
dirs = append(dirs, gccLibDirs(cc)...)
501+
}
502+
503+
// Fallback paths for common MinGW installations
504+
fallbacks := []string{
505+
"C:\\msys64\\mingw64\\lib",
506+
"C:\\msys64\\mingw32\\lib",
507+
"C:\\mingw64\\lib",
508+
"C:\\mingw32\\lib",
509+
"C:\\MinGW\\lib",
510+
}
511+
for _, dir := range fallbacks {
512+
if utilsfs.IsDir(dir) {
513+
dirs = append(dirs, dir)
514+
}
515+
}
516+
494517
seen := make(map[string]struct{}, len(dirs))
495518
unique := make([]string, 0, len(dirs))
496519
for _, dir := range dirs {

0 commit comments

Comments
 (0)